How do I force make/GCC to show me the commands?
I'm trying to debug a compilation problem, but I cannot seem to get GCC (or maybe it is make??) to show me the actual compiler and linker commands it is executing. Here is the output I am seeing: CCLD...
View ArticleCross platform dynamic libraries in "C" (Microsoft and gcc)
Ultimately I want to end up with a single set of source files that compiles to a Windows or Linux dynamic library depending on which platform compiled it.The problem seems to be that Windows requires...
View Articleagl build fails in "recipe perl-native-5.24.4-r0: task do_configure:"
I am trying to build AGL(with poky icefish) as per instructions in https://wiki.automotivelinux.org/agl-distro/source-code inside a container based off...
View ArticleHow to fix error cannot load plugin in gcc?
I am compiling a program with gcc plugin recently. My PC is X86_64 and i am doing this on my WSL. My goal is compile it with arm-gcc, so i installed arm-none-eabi-gcc in my WSL. When i want to compile...
View ArticleType casting: double to char: multiple questions
Consider this code:#include <stdio.h>int main(void) { /* TEST 1 */ double d = 128; char ch = (char)d; printf("%d\n", ch); /* TEST 2 */ printf("%d\n", (char)128.0); /* TEST 3 */ char ch1 =...
View ArticleUsing MinGW gcc to create DLLs for VBA 64 bit
I want to do what the title says. This has been discussed before (How to create dll using gcc compiler/Mingw for visual basic?), but these posts are 10 years old. I was writing Excel/VBA macros at that...
View ArticleMaximum size of size_t
I know in C return type of sizeof operator is size_t being unsigned integer type defined in <stdint.h>. Which means max size of it should be 65535 as stated in C99 standard 7.18.3:limit of size_t...
View ArticleInitialized Variable Length Array Working Variably (Between Computers)
I have some code that initializes arrays, specifically C-strings, using variables. For example...int len = getLength();char cstr[len+1] = {'\0'};This compiles and runs flawlessly in my code. However,...
View ArticleHow does GCC implement variable-length arrays?
How does GCC implement Variable-length arrays (VLAs)? Are such arrays essentially pointers to the dynamically allocated storage such as returned by alloca?The other alternative I could think of, is...
View ArticleHow do I move a buffer into the data segment using gcc inline assembly?
I want to try to use the ide_read_sectors and ide_write_sectors from OsDev's PCI IDE driver implementation here, https://wiki.osdev.org/PCI_IDE_Controller#Read.2FWrite_From_ATA_Drive.To move the buffer...
View ArticleHow to Instruct mingw64-gcc to use Specific mingw-w64-headers/crt
I have compiled mingw-w64-headers and mingw-w64-crt as described here.My issue is how to get gcc to use them.I have tried the following to no avail:SET mingw_dir=C:\msys64\mingw-w64gcc -g -L...
View ArticleHow to export abi for C++03 from the code written in C++17
We have a library written in C++17. Is there any way we build this library for C++03 ABI (for instance for gcc 4.4 or for modern gcc with std=c++03 on) assuming we fix the headers?
View ArticleGcc error: gcc: error trying to exec 'cc1': execvp: No such file or directory
I have been successfully using gcc on Linux Mint 12. Now I am getting an error. I have recently been doing some .so builds and installed Clang not to long ago, but have successfully compiled since both...
View Articleasm/errno.h: No such file or directory
While building gcc, I get this error:In file included from /usr/include/bits/errno.h:25, from /usr/include/errno.h:36, from ../.././gcc/tsystem.h:96, from...
View Articlewhat is this mysterious character in kernel main function? How can i remove it?
I am trying to create my own kernel following the link https://wiki.osdev.org/Bare_Bonesthe author has mentioned that " followed by some mysterious character. "Why is this character occurring? How can...
View ArticleUsing standard C++ library debug symbols? Ubuntu / Linux / libstdc++6-8-dbg?
There is a package called libstdc++6-8-dbg on Ubuntu Linux (latest version at time of writing).It is described as:GNU Standard C++ Library v3 (debugging files) This package contains the shared library...
View ArticleWhat do the constraints "Rah" and "Ral" mean in extended inline assembly?
This question is inspired by a question asked by someone on another forum. In the following code what does the extended inline assembly constraint Rah and Ral mean. I haven't seen these...
View Article"invalid use of incomplete type" error with partial template specialization
The following code:template <typename S, typename T>struct foo { void bar();};template <typename T>void foo <int, T>::bar() {}gives me the errorinvalid use of incomplete type 'struct...
View Articlegcc __builtin_expect doesn't seem to generate a correct code
The following two code snippets produces exactly the same assembly code, even though branches are enclosed with different branch predictions.Let's say that we have test0.c#define likely(x)...
View ArticleDefaulting non-startup modules to new section in custom linker script
I'm attempting to create a custom linker script that takes all functions except main and the internal startup functions and put them into a different segment named .text_enc.Sample code:mod1.c:#include...
View Article