-
Notifications
You must be signed in to change notification settings - Fork 746
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
make test
fails with msg about -fPIC
#86
Comments
I just tried this on a Xenial chroot and it's worked fine. The message you're getting is contradictory, it states that you can't build a shared library without using The dependencies of the build are minimal but there are lots of extras that interfere with the (generally) stable tools. Off the top of my head that may be things like "apparmour", "selinux", "ccache" and there are others. So to start we need version numbers of all the tools Also was this the iso you used ?
Did you BTW: I built the chroot (as root) like this:
And my (WORKING) versions are:
|
While gathering info I discovered that I actually used 16.10, not 16.04.1. I've installed 16.04.1 in another VM and everything worked there.
One big difference from your configuration is this: Thanks very much! |
Okay, It's the updated ASLR, you know the one that was shown to be (mostly) ineffective even on 64bit systems. There are a couple of distributions where it makes a small difference; Ubuntu is not one of them. |
@rdebath "updated ASLR" ? is ubuntu 16.10 exporting some weird default CFLAGS, or does it have some hardcoded into their gcc config ? |
On the GCC With normal shared libraries the libraries are PIC code; with that flag set an executable using shared libraries is also PIC. ASLR randomises the position of everything that's PIC, the linker tries to make sure nothing gets screwed by it. |
Workaround confirmed for Arch:
passes with flying colors.
|
Hello.
This may be my local issue, however I have vanilla xubuntu 16.04.1 VM (installed today) so it can be widespread.
After cloning repo and
make && make test
I get the following error:... ./8cc -w -o test/line.o -c test/line.c ./8cc -w -o test/testmain.o -c test/testmain.c cc -o test/line.bin test/line.o test/testmain.o /usr/bin/ld: test/testmain.o: relocation R_X86_64_PC32 against symbol 'printf@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status Makefile:20: recipe for target 'test/line.bin' failed make: *** [test/line.bin] Error 1 rm test/line.o test/testmain.o
I've spent several hours on this but haven't found a solution. However in C/C++ I am total newb right now. Maybe it will be helpful to update makefile somehow to solve this problem or add some note to README.MD about the issue.
Happy new year!
The text was updated successfully, but these errors were encountered: