14,260 questions
Advice
0
votes
1
replies
105
views
Two Rust crates each bundle their own libcrypto (OpenSSL + BoringSSL) and fight over the same symbols — what's the right way to deal with this?
Spent way too long on this one so I'm hoping someone's hit it before.
I've got a desktop app in Rust. Two of my dependencies each drag in their own copy of a C crypto library:
rusqlite with bundled-...
Advice
0
votes
3
replies
53
views
binary compiled on RHEL-7.x with libcrypt.so.1, facing issue to run on RHEL-10 as libcrypt.so.1 deprecated
I have my Linux binary compiled on RHEL-7.x with libcrypt.so.1, facing issue to run on RHEL-10 as libcrypt.so.1 deprecated.
I know compiling my binary on RHEL-10 , it will solve the issue.
Looking for ...
Score of 1
2 answers
78 views
Can I use the LLVM linker (or related tool) to embed the data from a file into an object file?
Using the GNU linker, it is possible to embed the contents of a file into an object file (and eventually, an executable). For example, suppose my input is foo.bin and I want an object file named bar.o;...
Score of 5
2 answers
165 views
Can't link mremap in C header
I'm working on a mini allocator for some efficient data structures in a project, and I'm having some difficulty importing mremap. Other sys/mman.h functions like mmap and munmap are working as ...
Score of 1
1 answer
93 views
How to link compiled module interfaces and object files?
Just for a simple example, I have a project like this:
.
├── animals.cpp
├── animals.cppm
├── gcm.cache
│ ├── animals.gcm
│ └── std.gcm
└── main.cpp
It can be compiled and linked like this:
g++ -...
Score of -1
1 answer
128 views
Why do I get link errors regarding vtables of my type erased objects? [duplicate]
I'm trying to implement a type erased class for a project. Here's a simplified example of what I'm trying to do:
#include <iostream>
struct MyClass
{
struct TypeWrapper
{
...
Score of 2
1 answer
88 views
How to interpret the value of an ABS symbol in a ELF file?
I was looking to the symbols in the libc.a file and I noticed there some "ABS" symbols.
For example, there is the "_nl_current_LC_COLLATE_used" symbol.
Here is the output of ...
Score of 0
0 answers
95 views
Using ld on macOS to turn a raw arm64 binary into an executable Mach-O binary
I am working making an assembler that compiles bf code into an executable that can be run on macOS. Essentially, I run the compiler, which outputs a raw arm64 binary to output.bin (i.e., a binary that ...
Score of 0
1 answer
100 views
What is IMPORTED_SONAME used for?
Lets say I have an imported library libmylib.so.1.0 with SONAME = libmylib.so field.
When importing the library
add_library(mylib SHARED IMPORTED)
set_target_properties(mylib PROPERTIES ...
Advice
0
votes
8
replies
212
views
Confused about C++ linkage
After a couple of years in the industry, I am only now facing the dilemmas of C++ linkers.
In the good old days of university, I had this simplistic view where "static library" meant the ...
Score of 1
1 answer
127 views
Making non cuda code compatible with cuda which uses std functions where cuda::std exists
I'm attempting to create a function that handles bit casting a float/double/float16 to an unsigned key of equivalent size. I can do this in host code easily with
template<std::floating_point T>
...
Best practices
1
vote
5
replies
139
views
Is Link-Time Dependency Injection possible in any common linkers?
I've been using Java and Google's Dagger2 dependency injection, and contemplating how to implement similar Dependency Injection in C++ with little-to-no overhead. One stumbling block I've found is ...
Advice
0
votes
5
replies
120
views
Where are the inherited additional dependencies defined in a C++ project in Visual Studio and filled in during linking?
In my C++ project in Visual Studio, the linker's additional dependencies are defined as follows:
During build, I can see that this gets evaluated as:
29> AdditionalDependencies=system.lib;dexsys....
Advice
0
votes
6
replies
108
views
How to properly add a new section in internal RAM without breaking this linker script?
I am working on an embedded project in a microcontroller based on Cortex M7 and I've been asked to modify this linker script to add a new section .new_section which will always stay at the beginning ...
Score of 4
1 answer
207 views
Global variables not working in my kernel
I want to write a 16-bit real mode OS in C. And I found out that I should use Open Watcom C compiler and Linker.
I used local variables in my main function in the kernel code, and I managed to print ...