We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS: Arch linux amd64 C Compiler: gcc-14.2.1
I followed the documentation, compiled foo.c3 to static-lib using c3c static-lib command, and renamed foo.a to libfoo.a.
However, I have no clue on this part:
int foo_square(int) __attribute__ ((weak, alias ("foo.square")));
nm -g foo.a
and I could see foo__square in the output, so I changed alias name to foo__square. It didn't work. The compile command:
gcc test.c -L. -l foo -o main
or
gcc test.c -L. -l foo -Wl,--defsym=foo_square=foo__square
didn't compile. I changed to C code. 2. Use extern or asm instead. To compile, I changed the C code to this:
int foo_square(int) asm("foo__square");
and it compiled successfully with proper result.
I'm not sure why the export symbols is different, perhaps it's platform depent?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
OS: Arch linux amd64
C Compiler: gcc-14.2.1
I followed the documentation, compiled foo.c3 to static-lib using c3c static-lib command, and renamed foo.a to libfoo.a.
However, I have no clue on this part:
I used nm to check the symbol
and I could see foo__square in the output, so I changed alias name to foo__square. It didn't work.
The compile command:
or
didn't compile. I changed to C code.
2. Use extern or asm instead.
To compile, I changed the C code to this:
and it compiled successfully with proper result.
I'm not sure why the export symbols is different, perhaps it's platform depent?
The text was updated successfully, but these errors were encountered: