All Questions
2,138
questions
1
vote
0
answers
36
views
Correct Method to Place Multiple Arrays in a Custom Flash Section in C using GCC
I need to store a constant array in flash memory at a specific location using GCC in my embedded C project. For a uint32_t value, I managed to do it like this, and it works:
const uint32_t ...
1
vote
1
answer
23
views
Understanding GCC Compilation: Preprocessing vs Linking with Libraries
I have a question regarding compilation with GCC.
I have a slight confusion that I believe I've figured out but would like confirmation on. In the first compilation step, preprocessing (cpp) organizes ...
0
votes
1
answer
16
views
STM32CubeIDE: How to exclude memory sections in linker script from output file
In my cube project, I need to generate a bin file as the output. The output bin file is over 2GB because it includes a RAM section (0x30000000) in the output as well as the required flash section (...
0
votes
0
answers
52
views
Linux: GCC 9.3: linking against a dynamic library compiled with GCC 4.8
So, I have a proprietary library (not open source) that was compiled with Devtoolset-3 (GCC 4.8). Currently, Devtoolset-3 is marked as EOL (end-of-life) for the target distro (CentOS 7). So, ...
0
votes
2
answers
49
views
How to properly link libsndfile when compiling a standalone file using gcc
I'm using the libsndfile library for a signal processing project. I'm compiling c code using gcc on a WSL Ubuntu shell. I installed libsndfile-dev using sudo apt-get install libsndfile1-dev, as well ...
1
vote
0
answers
19
views
Can GCC use LTO to optimize MIPS load/store instruction pairs for linker-defined addresses that are close together
Problem Statement
Assume 32-bit MIPS I, and code written in C for an embedded system.
When loading from an externally defined variable (extern int myVar;) that comes from a symbol defined in a linker ...
1
vote
2
answers
55
views
Problems of linking Ws2_32.lib using gcc
I thought that when I install gcc and mingw that crucial windows libraries are already imported with that. Apperantly not. Now how do I give the gcc linker the required libraries so that it can link ...
0
votes
0
answers
24
views
Why can't my custom cross GCC find some libraries in the sysroot, even if it searches in the right place?
I'm trying to cross compile a C/C++ application, and since it needs an old version of libc, I compiled a custom GCC without --with-sysroot flag, and I use as sysroot a copy of the target root ...
3
votes
1
answer
89
views
section of static library is changed with unkown reason
I am using arm-none-eabi-gcc (V6.3), and CPU core is ARM COrtexM0.
In my linker file, I make 2 sections for text and rodata.
The .text section is for all the C code text and rodata, except for the ...
0
votes
0
answers
39
views
Why can't Clang/lld find `__dlopen`, `__dlclose` and `__dlsym`?
Following from this question, I am trying to compile a C/C++ project that targets an old Linux system. To have the old libraries at hand, I made a copy of the target root fs, and since GCC has ...
0
votes
1
answer
45
views
C connection to mysql gcc linker error in windows
I am using c in Windows. I need to use mysql.
I am having a really hard time trying to compile c code with mysql in it on Windows 11 os.
I had it easy in linux where I just needed to run either of the ...
0
votes
0
answers
38
views
Linking error while trying to compile binutils from source
My environment:
Darwin MacBook-Air-2.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
So im trying to compile binutils-2.42 ...
0
votes
1
answer
27
views
GCC/G++ Linking issue. Bit of a noob question [duplicate]
I have a project that was build with cmake. The project creates a library (.a) in one directory, and then the application (from another directory) links in this library. It's using GCC as the ...
0
votes
0
answers
21
views
Linker error: Undefined reference error _dl_stack_flags with Qt 5.12.5 crosscompiler(Raspberry PI3) and pthreads
I'm trying to include the libusb-1.0 library in order to use it in the Qt 5.12.5 project for Raspberry PI3. I built a cross-compiler for Raspberry Pi3 under Ubuntu, the cross-compiler works fine. When ...
0
votes
1
answer
68
views
C: Linking shared libraries during building vs using libdl at runtime
This website says there are 2 ways of using shared object files (.so):
Dynamically linked at run time. The libraries must be available during compile/link phase. The shared objects are not included ...