14,279 questions
1
vote
1
answer
43
views
.so file built on same CPU but different EC2 instances lead to missing symbols
I am building a wheel of PyTorch from source, based on their https://github.com/pytorch/pytorch/blob/v2.6.0/.ci/manywheel/build_common.sh CI build script. I tested on a "local" instance of a ...
0
votes
0
answers
44
views
How does cargo and/or link.exe interact together to find a static lib on Windows?
I have a project that fails to build.
PS C:\Users\me\Data\personal\rust\sdl-learn> cargo build
Compiling sdl-learn v0.1.0 (C:\Users\me\Data\personal\rust\sdl-learn)
error: linking with `link.exe`...
5
votes
1
answer
76
views
write(2) syscall returns EFAULT for string in .rodata on OpenBSD 7.3--7.8
I'm writing a hello-world program in i386 assembly for OpenBSD 7.8. The program works if the string (buf argument of write(2)) is in .data or on the stack, but write(2) returns EFAULT (== 14) if the ...
0
votes
0
answers
54
views
How to override the -fuse-ld flag in CLion?
I have a CMake based Windows library project that only links successfully with the MSVC link.exe due to some obscure third party library dependencies. However, I want to compile the project using the ...
-1
votes
1
answer
94
views
Cannot build shared library with static member function declared in header [duplicate]
Minimum reproducible example:
// dynamic.hpp
class Test {
private:
static void update();
};
// dynamic.cpp
#include "dynamic.hpp"
#include <iostream>
void Test::update() {
...
2
votes
1
answer
106
views
Is there a robust way to version all exported symbols with version script without changing the visibility?
GNU documentation is really poor and is worded in a way that seem to imply that you can only assign version only to symbols that are listed explicitly either under global: or local:, but those are ...
0
votes
0
answers
34
views
avr-gcc: error: -fuse-linker-plugin is not supported in this configuration
I'm cross-compiling avr-gcc statically (in order not to depend on Android linker) to work on aarch64 android devices.
gcc is compiled with the flags:
generic_arm64:/data/data/myapp/files/sdk/hardware/...
3
votes
0
answers
107
views
Strange gaps in ARM GCC linker sections
TLDR: On an embedded system, I have to place certain buffers to their own section to be used with DMA. However, the resulting section seems to contain unexplainable gaps. What could be going wrong?
...
4
votes
1
answer
104
views
Visual C++ link weirdness with bcrypt.dll
On Windows 11, the BCrypt library contains the Microsoft cryptographic functions. I have noticed a unique behaviour of the linker when linking against bcrypt.dll and I would appreciate the opinion of ...
0
votes
0
answers
25
views
Is it possible to link a dynamic library using a higher version of glibc in a compilation environment with a lower version of glibc?
The scenario is this: My compilation environment is unified, using the lower-level glibc_2.18. I want to depend on a CUDA .so file compiled using the higher-level glibc_2.27.
My runtime environment ...
0
votes
1
answer
51
views
Why doesn't RTLD_LOCAL solve this symbol conflict when loading dynamic libraries?
I have one dynamic library with the function:
extern "C" void start() {
}
And a second dynamic library with the function:
extern "C" void start() {
}
Exactly the same. I open up ...
6
votes
1
answer
119
views
When inline function definition and extern function declaration are all present in one .c file, no link error is observed
Even though this might look like duplication, I'd claim that it isn't.
Why does a compiler make the Foo function, which is defined in foo.c as inline double Foo() { return 1.2; }, a global function if ...
5
votes
1
answer
202
views
Linking Zig and Go for windows API
I'm trying to link a zig static library with golang. here is my build.zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const windows = b.option(bool, "windows&...
0
votes
0
answers
70
views
iOS archiving for release strips away global symbols
I have a cocoapods library.
This library has some C functions that I have exposed globally:
#define EXPORT __attribute__((visibility("default"), used, retain)) extern "C"
EXPORT ...
0
votes
1
answer
41
views
in CLion, how can I choose a linker other than my C/C++ compiler?
I'm using CLion to build a C++ or a C project. Looking at the project's CMake Profiles, I notice I can choose a toolchain; and looking at the toolchains dialog, I see an entry for choosing a C ...
1
vote
0
answers
58
views
How to specify custom link line/link order in CMake?
TL;DR: Is there a way to specify custom link order when CMake managed dependencies seems not enough?
I'm developing a toy OS for fun and having trouble linking in the GCC crt* files responsible for ...
0
votes
1
answer
105
views
RISC-V GCC Force Linker Relaxation with GP Register to Address Static Data
I'm writing a bare-metal firmware for a virtual RISC-V SoC. Below is code that communicates with a physical device on the SoC and it is using constant data from the my_data array that sits in ROM. The ...
2
votes
1
answer
161
views
Cannot link to just libglfw.so (Have to include libglfw.so.3 as well)
I am making a small application with glfw. I'm not using CMake and instead opted to make a custom build system for more control, but I'm getting an error when trying to run my program:
error while ...
0
votes
1
answer
102
views
MontaVista GCC linker throws `cannot find -lgcc_s`
I have the task of containerizing an ancient embedded build plan which uses the MontaVista GCC toolchain released in 2006. Unfortunately, the senior insists on using a setup similar to the old build ...
0
votes
0
answers
70
views
Scatter File Organization and Compiling
I'd like to preface this with the understanding that I'm not the most knowledgeable on scatter files, but I've been learning a lot in the ARM forums about them.
I'm working with the STM32F429 ...
1
vote
1
answer
73
views
Linker placement order is reversed in map file after compiling
I am adding a linker section in the TI arm clang linker and I have added by following
MEMORY
{
TEST_SECTION ( RWIX ) : ORIGIN = 0x41C00000 , LENGTH = 0x00007800
}
--retain="*(....
0
votes
1
answer
95
views
Does the specific linker used affect how asm file is interpreted?
Wondering if the specific linker used affects how asm file is interpreted.
I am using NASM on windows 11, 64-bit, x64 processor. The linker I have is GoLink, but I'm not sure if that's the most ...
1
vote
2
answers
107
views
Verifying no footprint on production code when optionally adding fault injection
I have the following task: Given source code A, modify it into source code B such that it can optionally enable fault injection. When the fault injection is disabled, it shall output the exact same ...
1
vote
1
answer
57
views
GAS creates a PLT relocation entry for call to an extern symbol?
I assembled the following file with GAS, the GNU assembler:
.extern foo
.global bar
.section .text
bar:
call foo
ret
In the object file it produced there is a relocation entry of type ...
1
vote
1
answer
284
views
Conflicting OPENSSL versions under Linux
I'm building a project linking both with QtNetwork (Qt6) and Python library (3.8).
At runtime, I get the error:
my_prg_bin: symbol lookup error: /lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl,...