Skip to content
New issue

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

Does not compile on some Linux distro #3

Closed
cacharle opened this issue Oct 21, 2020 · 0 comments
Closed

Does not compile on some Linux distro #3

cacharle opened this issue Oct 21, 2020 · 0 comments

Comments

@cacharle
Copy link
Owner

cacharle commented Oct 21, 2020

Worked with

$ gcc --version
clang version 9.0.0-2~ubuntu18.04.2 (tags/RELEASE_900/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

But not with:

$ uname -a
Linux manjaro 5.4.67-1-MANJARO #1 SMP PREEMPT Wed Sep 23 14:20:18 UTC 2020 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Output:

gcc -I. -Wall -Wextra -Wno-nonnull -c -o main.o main.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o helper.o helper.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o test/ft_strlen_test.o test/ft_strlen_test.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o test/ft_strcpy_test.o test/ft_strcpy_test.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o test/ft_strcmp_test.o test/ft_strcmp_test.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o test/ft_write_test.o test/ft_write_test.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o test/ft_read_test.o test/ft_read_test.c
gcc -I. -Wall -Wextra -Wno-nonnull -c -o test/ft_strdup_test.o test/ft_strdup_test.c
gcc -o runtest main.o helper.o test/ft_strlen_test.o test/ft_strcpy_test.o test/ft_strcmp_test.o test/ft_write_test.o test/ft_read_test.o test/ft_strdup_test.o -L../pg -lasm
/usr/bin/ld: ../libasm/libasm.a(ft_read.o): warning: relocation against `__errno_location@@GLIBC_2.2.5' in read-only section `.text'
/usr/bin/ld: ../libasm/libasm.a(ft_write.o): relocation R_X86_64_PC32 against symbol `__errno_location@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Recompiling with -fPIC, -fPIE or making a shared library did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant