rumpkernel / rumprun

The Rumprun unikernel and toolchain for various platforms
Other
1.14k stars 128 forks source link

Fix linking on Debian Stretch #100

Closed liuw closed 7 years ago

liuw commented 7 years ago

Provide cc-option. Use that to check if -no-pie is available and append it when necessary.

Fixes #99

kent-mcleod commented 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:

!!! !!! 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? 
liuw commented 7 years ago

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.

kent-mcleod commented 7 years ago

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.

liuw commented 7 years ago

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.