Closed liuw closed 7 years ago
Hello, I was trying to test this to see if it fixed my linking errors on Debian Stretch and am still seeing some errors. Specifically:
CXX=false ./build-rr.sh hw
I still get -r and -pie may not be used together
when trying to build librumprunfs_base.a. I found modifying app-tools/cookfs.in to add the -no-pie flag where it uses -r fixed these errors. -r and -pie may not be used together
error. This is non surprising as the toolchains weren't built with -no-pie. I add -no-pie like so: x86_64-rumprun-netbsd-gcc -no-pie hello.c -o hello
and everything works.
$ rumprun-bake hw_generic hello.bin hello
!!! !!! NOTE: rumprun-bake is experimental. syntax may change in the future !!!
/usr/bin/ld: /home/kentm/workspaces/july/rump-hw/rumprun/./rumprun-wip.linking-on-stretch/rumprun-x86_64/lib/rumprun-hw/rumprun.o: relocation R_X86_64_32 against `.bootstrap' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status
The approach mentioned in #85, specifically `CXX=false ./build-rr.sh hw -- -F ACLFLAGS=-no-pie` also causes errors when -no-pie is passed to cc1 it throws the error `cc1: error: command line option '--no-pie' is valid for the driver but not for C`
Do you encounter these same errors when trying to run a simple hello world on the hw platform?
Do you encounter these same errors when trying to run a simple hello world on the hw platform?
Yes.
This patch included changes to both HW and Xen platform because I knew how the issue happened and tried to fix it for both platforms.
Unfortunately this patch is incomplete. I missed some places in the toolchain. I don't have time to fix it in the near future. You're welcome to take over my patch to fix the issue.
I edited rumprun-bake to add -no-pie to the final linking step which seemed to fix the final error I was getting. Now I get a bare metal image that I can successfully run. I can take over the patch.
I will close this pull request now. There is no point to leave it pending.
Feel free to submit your own PR. Just keep my signed-off-by if you use my patch as baseline for your patch.
Provide cc-option. Use that to check if -no-pie is available and append it when necessary.
Fixes #99