Skip to content

buildgcc: Build GMP --with-pic if GCC defaults to -pie#1

Open
iseeareddoor wants to merge 1 commit intoosresearch:masterfrom
iseeareddoor:gcc-6
Open

buildgcc: Build GMP --with-pic if GCC defaults to -pie#1
iseeareddoor wants to merge 1 commit intoosresearch:masterfrom
iseeareddoor:gcc-6

Conversation

@iseeareddoor
Copy link

GCC 6 can optionally default to building all binaries as position
independent executables (PIE). This breaks linking against static
libraries that are compiled without position independent code (PIC).

Building GMP --with-pic in this case seems to be the least fragile
solution.

TEST=Run make all and make BUILDGCC_OPTIONS=-b build-i386 in
util/crossgcc on Debian Stretch.

Change-Id: I5f3185af9c8d599379a628e18724b217b88be974
Signed-off-by: Nico Huber nico.huber@secunet.com
Reviewed-on: https://review.coreboot.org/17936
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net
Reviewed-by: Jonathan Neuschäfer j.neuschaefer@gmx.net

GCC 6 can optionally default to building all binaries as position
independent executables (PIE). This breaks linking against static
libraries that are compiled without position independent code (PIC).

Building GMP `--with-pic` in this case seems to be the least fragile
solution.

TEST=Run `make all` and `make BUILDGCC_OPTIONS=-b build-i386` in
     util/crossgcc on Debian Stretch.

Change-Id: I5f3185af9c8d599379a628e18724b217b88be974
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/17936
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
@iseeareddoor
Copy link
Author

since there are no issues allowed here, I opened a pull request instead - if you rather want such things to be reported against the main heads repository, please tell.

please cherry-pick this commit from upstream (coreboot@8bbd596), without it building with GCC-6 (Debian Stretch/Sid) is broken because of the default PIE compile flags.

I verified that with it included the crossgcc build works and I get a qemu.rom built which outputs some coreboot stuff on the console when started with Qemu - there is little documentation on what is supposed to work with Qemu and how to test it?

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

Successfully merging this pull request may close these issues.

2 participants

Comments