https://ticket.coreboot.org/https://ticket.coreboot.org/themes/PurpleMine2-2.16.2/favicon/favicon.ico?12017-01-31T07:27:04ZIssue Trackercoreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2272017-01-31T07:27:04ZPaul Menzelpmenzel+ticket.coreboot@molgen.mpg.de
<ul></ul><p>Commit a3e9da05 (configure: add check for -no-pie if the compiler default to -fPIE) should have fixed the build issue in GRUB.</p>
<pre><code>commit a3e9da054d00260f274cfd9d1b9611c32ecd437c
Author: Magnus Granberg <>
AuthorDate: Wed Dec 14 20:44:41 2016 +0300
Commit: Andrei Borzenkov <>
CommitDate: Wed Dec 14 20:44:41 2016 +0300
configure: add check for -no-pie if the compiler default to -fPIE
When Grub is compile with gcc 6.1 that have --enable-defult-pie set.
It fail with.
-ffreestanding -m32 -Wl,-melf_i386 -Wl,--build-id=none -nostdlib -Wl,-N -Wl,-r,-d -
o trig.module trig_module-trigtables.o
grep 'MARKER' gcry_whirlpool.marker.new > gcry_whirlpool.marker; rm -f
gcry_whirlpool.marker.new
/usr/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: -r and -
shared may not be used together
collect2: error: ld returned 1 exit status
Makefile:26993: recipe for target 'trig.module' failed
Check that compiler supports -no-pie and add it to linker flags.
</code></pre>
<p>With that I can successfully build the master branch from GRUB with the toolchain from Debian (Sid/unstable).</p>
<p>Please create a separate ticket for the other issue, and add how you add the GRUB ELF file to the CBFS image.</p>
<pre><code>$ git log --oneline -1
970af16 vgasrc: Increase debug level
$ git grep "No support for com"
src/fw/coreboot.c: dprintf(1, "No support for compression type %x\n"
</code></pre> coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2292017-02-03T15:10:10ZNathaniel Roachnroach44@gmail.com
<ul></ul><p>I created a new copy of the git tree and built from scratch in there - it all seemed to work fine. I'm a little confused as I did rebuild the toolchain, but it works now so I'm not fussed.</p>
<p>Cheers for your time.</p>
coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2322017-03-10T13:36:54ZSGS ITsgsit.cb@gmail.com
<ul></ul><p>I'm still getting this issue with the latest coreboot code on Debian Stretch, when adding GRUB as primary payload. Is there a workaround?</p>
coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2332017-03-10T13:55:00ZPaul Menzelpmenzel+ticket.coreboot@molgen.mpg.de
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul><p>SGS IT, are you using GRUB master? Please post your configuration file (<code>.config</code>).</p>
coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2342017-03-10T15:39:57ZSGS ITsgsit.cb@gmail.com
<ul><li><strong>File</strong> <a href="/attachments/80">dotconfig</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/80/dotconfig">dotconfig</a> added</li></ul><p>Thanks for replying so quickly, Paul. Yes I am - config file attached.</p>
coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2352017-03-10T15:46:52ZPaul Menzelpmenzel+ticket.coreboot@molgen.mpg.de
<ul></ul><p>Indeed, GRUB master is used. Just to be sure, could you please delete the folder <code>grub</code>(?) in <code>payloads/external/GRUB2/</code>, and rerun the build. If it doesn’t work, please paste the build error.</p>
<p>PS: Also please note, coreboot is officially written all lowercase.</p>
coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2362017-03-10T16:07:56ZSGS ITsgsit.cb@gmail.com
<ul></ul><p>Apologies for the incorrect casing. I still get the following error after deleting the grub2 folder (same as OP)</p>
<p><code>config.status: creating grub-reboot<br>
Making all in grub-core<br>
/usr/bin/ld: -r and -pie may not be used together<br>
collect2: error: ld returned 1 exit status<br>
Makefile:24260: recipe for target 'disk.module' failed<br>
make[5]: *** [disk.module] Error 1<br>
Makefile:23531: recipe for target 'all' failed<br>
make[4]: *** [all] Error 2<br>
Makefile:10897: recipe for target 'all-recursive' failed<br>
make[3]: *** [all-recursive] Error 1<br>
Makefile:3123: recipe for target 'all' failed<br>
make[2]: *** [all] Error 2<br>
Makefile:49: recipe for target 'grub2' failed<br>
make[1]: *** [grub2] Error 2<br>
payloads/external/Makefile.inc:134: recipe for target 'grub2' failed<br>
make: *** [grub2] Error 2</code></p>
coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2372017-03-10T16:11:36ZPaul Menzelpmenzel+ticket.coreboot@molgen.mpg.de
<ul></ul><p>No idea right now. More next week.</p>
<p>Maybe one more thing. <code>cd payloads/external/GRUB2/grub2</code> and then please post the output of <code>git status</code>, and <code>git log --oneline -1</code>.</p>
<p>Also, can you build GRUB manually?</p>
<pre><code>$ ./autogen.sh
$ ./configure --with-platform=coreboot
$ make
$ make default_payload.elf
</code></pre> coreboot - Bug #90: GRUB fails to build under Debian testinghttps://ticket.coreboot.org/issues/90?journal_id=2382017-03-10T17:04:42ZSGS ITsgsit.cb@gmail.com
<ul></ul><pre><code>$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
build/
nothing added to commit but untracked files present (use "git add" to track)
</code></pre><pre><code>$ git log --oneline -1
bcf3c5553 xen: Fix wrong register in relocator.
</code></pre>
<p>A manual build of GRUB completes successfully.</p>