Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662678 - sys-boot/syslinux: UEFI booting does not work when built with sys-devel/binutils-2.31.1
Summary: sys-boot/syslinux: UEFI booting does not work when built with sys-devel/binut...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2018-08-02 21:52 UTC by Piotr Karbowski (RETIRED)
Modified: 2023-10-01 06:15 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0017-single-load-segment.patch (0017-single-load-segment.patch,4.63 KB, patch)
2019-02-15 12:40 UTC, Chí-Thanh Christopher Nguyễn
Details | Diff
syslinux-6.04_pre1-R_X86_64_PLT32.patch (syslinux-6.04_pre1-R_X86_64_PLT32.patch,431 bytes, patch)
2019-02-16 20:15 UTC, Chí-Thanh Christopher Nguyễn
Details | Diff
sys-boot/syslinux-6.04_pre1-r2 build log gzip-ed (sys-boot:syslinux-6.04_pre1-r2:20200913-122914.log.gz,95.04 KB, application/gzip)
2020-09-13 14:11 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Karbowski (RETIRED) gentoo-dev 2018-08-02 21:52:37 UTC
Today I tried to boot using UEFI and syslinux.efi and both the 6.04_pre1 and 6.03 did not worked for me. After loading the syslinux.efi (including bootx64.efi form) it just 'freeze', like no EFI framebuffer gets updated.

However when I took syslinux.efi and *.c32 from efi64 of offical build of syslinux, I did got a working menu.c32 output.

Looks like something goes wrong with building it.

emerge --info:
Portage 2.3.44 (python 3.6.6-final-0, default/linux/amd64/17.0, gcc-7.3.0, glibc-2.27-r5, 4.17.6 x86_64)
=================================================================
System uname: Linux-4.17.6-x86_64-Intel-R-_Core-TM-_i5-6300U_CPU_@_2.40GHz-with-gentoo-2.6
KiB Mem:    16249628 total,   5886856 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Sat, 28 Jul 2018 12:30:01 +0000
Head commit of repository gentoo: df9d497e52a431eb2b4bce6192c9b5cf725c2758
sh bash 4.4_p23
ld GNU ld (Gentoo 2.30 p3) 2.30.0
ccache version 3.3.4 [enabled]
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.12.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r3::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.9.1::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r3::gentoo
sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r5::gentoo
Repositories:

gentoo
    location: /var/portage/tree
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

deadbeef-overlay
    location: /var/lib/layman/deadbeef-overlay
    masters: gentoo
    priority: 50

foo-overlay
    location: /var/lib/layman/foo-overlay
    masters: gentoo
    priority: 50

seden
    location: /var/lib/layman/seden
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=native"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS=" --with-bdeps y --binpkg-respect-use y --buildpkg-exclude 'virtual/* sys-kernel/*-sources games-*/* app-emulation/emul-linux-*' --backtrack 300 "
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache distlocks ebuild-locks fixlafiles merge-sync multilib-strict news noinfo parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.heanet.ie/pub/gentoo/ http://distfiles.gentoo.org/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--quiet -j4"
PKGDIR="/var/portage/packages"
PORTAGE_COMPRESS="bzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/portage/tmp"
USE="acl amd64 berkdb bzip2 cli crypt cups cxx dri fontconfig fortran gdbm glamor iconv jpeg libtirpc logrotate modules multilib ncurses nls nptl opengl openmp pam pcre pic png readline seccomp smp ssl tcpd threads unicode vim-syntax xattr xft zlib zsh-completion" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby21 ruby23 ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Piotr Karbowski (RETIRED) gentoo-dev 2018-08-03 16:29:25 UTC
One can easly reproduce the issue:

1. create fat32 formated filesystem with EF00 type on usb stick.
2. on the usb stic create EFI/BOOT directories.
3. copy all of /usr/share/syslinux/efi64/ into EFI/BOOT
4. rename syslinux.efi to BOOTX64.EFI
5. Boot from this usb stick in UEFI mode.

Now the framebuffer of EFI will just freeze, or not update. However if one take the syslinux.efi ldlinux.e64 and all *.c32 from official binary tarball of syslinux, it will work.
Comment 2 Chí-Thanh Christopher Nguyễn gentoo-dev 2018-08-06 20:51:32 UTC
(In reply to Piotr Karbowski from comment #0)
> CFLAGS="-O3 -pipe -march=native"

Does it make a difference if you use -O2 instead of -O3 in CFLAGS?
Comment 3 Piotr Karbowski (RETIRED) gentoo-dev 2018-10-17 17:40:50 UTC
syslinux by default ignores user cflags and goes with Os. So no O3 is used. Gentoo's binaries of syslinux does not work.
Comment 4 Piotr Karbowski (RETIRED) gentoo-dev 2018-10-17 17:51:59 UTC
I've added above in comments steps to reproduce. Can any of you test it? Just load a vesamenu.c32 EUFI syslinux. If it shows, then it works.
Comment 5 Chí-Thanh Christopher Nguyễn gentoo-dev 2018-10-18 22:26:56 UTC
You are correct that parts of the build (the COM32 and EFI executables) ignore user CFLAGS by default. Some auxiliary stuff will still get the flags.

Also linker and its flags can still interfere with the build, cf. bug 563364.

Anyway, the emerge built menu.c32 works here on a UEFI system, so it there must be a difference in your system which causes that.
Comment 6 Piotr Karbowski (RETIRED) gentoo-dev 2018-10-19 05:37:34 UTC
Good to hear that it works for you, so there's a hope to get it working here. :)

Would you kindly share with me your CFLAGS and if you use ~amd64 or amd64 system?

Meanwhile I also re-built my system with emptytree @world from O3 to O2, and I will resume testing.
Comment 7 Piotr Karbowski (RETIRED) gentoo-dev 2018-10-19 19:38:43 UTC
So I have system rebuilt with '-O2 -pipe -march=native' and if I use the /usr/share/syslinux/efi64/syslinux.efi as EFI/BOOT/BOOTX64.EFI after I select in boot menu the pendrive that I placed it on, it just goes black screen and goes back to the bios's menu to select device. It used to just hang when my system was built with O3.

If I only replace the BOOTX64.EFI (syslinux.efi) with the one from prebuilt official syslinux package, I can fully boot my system in EFI mode. All the c32 modules come from my gentoo's install.

Can you perhaps re-build syslinux and while taking backup, test the newly built syslinux.efi on your system?
Comment 8 Piotr Karbowski (RETIRED) gentoo-dev 2018-10-19 20:13:19 UTC
What I also noticed is that original syslinux.efi is 200 kB, where the one built on gentoo is 120 kB.
Comment 9 Chí-Thanh Christopher Nguyễn gentoo-dev 2019-02-14 22:13:08 UTC
Sorry I did not reply earlier. After you commented, I built syslinux-6.04_pre1 again and it booted fine on 64-bit EFI.

-rwxr-xr-x 1 root root 173K 22. Nov 22:07 syslinux.efi
Comment 10 Piotr Karbowski (RETIRED) gentoo-dev 2019-02-15 09:05:47 UTC
Hi,

To follow up our yesterday's discussion on IRC.

I've confirmed that syslinux built on latest stage3 seems to have right size, however Ihe moment I update the stage3 to ~amd64, first glibc and gcc, then removal of old gcc and emerge -e @world, without changing profile, the syslinux.efi appears to not have right size.

-rwxr-xr-x 1 root root 121588 2019-02-15 09:00 /usr/share/syslinux/efi64/syslinux.efi

Here's emerge --info from my chroot I just tested it on

Portage 2.3.60 (python 3.6.6-final-0, default/linux/amd64/17.0, gcc-8.2.0, glibc-2.28-r5, 4.20.0 x86_64)
=================================================================
System uname: Linux-4.20.0-x86_64-AMD_Ryzen_7_2700_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    16436368 total,   7954100 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Fri, 15 Feb 2019 00:45:01 +0000
Head commit of repository gentoo: 61ec4f38392e94c679c338772010a9d554e29181
sh bash 5.0_p2
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
app-shells/bash:          5.0_p2::gentoo
dev-lang/perl:            5.28.0::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.40.3::gentoo
sys-apps/sandbox:         2.15::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r4::gentoo
sys-devel/gcc:            8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli crypt cxx dri fortran gdbm iconv ipv6 libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp ssl tcpd unicode xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 11 Piotr Karbowski (RETIRED) gentoo-dev 2019-02-15 10:40:04 UTC
The binutils appears to be the problem here.

syslinux.efi built with 2.30 is 176K, built with 2.31.3 is 120K and does not work.
Comment 12 Chí-Thanh Christopher Nguyễn gentoo-dev 2019-02-15 12:40:45 UTC
Created attachment 565452 [details, diff]
0017-single-load-segment.patch

patch from Debian
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2019-02-15 20:15:37 UTC
(In reply to Piotr Karbowski from comment #11)
> The binutils appears to be the problem here.
> 
> syslinux.efi built with 2.30 is 176K, built with 2.31.3 is 120K and does not
> work.

Can you attack both working and non-working binaries? It would be interesting to diff them.
Comment 14 Piotr Karbowski (RETIRED) gentoo-dev 2019-02-16 13:12:43 UTC
I do not have good news.

I've tried the binutils 2.31 and this patch for syslinux - size of syslinux.efi appears to be good but it does freeze on startup.

I've also eselect 2.30 binutils and built syslinux without this patch, size is again good, but freeze the same way

Restoring the syslinux.efi binary out of release package - this one works okay.

Can any of you gents test the syslinux.eif out of fully updated ~amd64 system? Maybe you will have better idea how to find the reason for that.
Comment 15 Chí-Thanh Christopher Nguyễn gentoo-dev 2019-02-16 20:15:45 UTC
Created attachment 565566 [details, diff]
syslinux-6.04_pre1-R_X86_64_PLT32.patch

also try this patch in addition to the above one
Comment 16 Larry the Git Cow gentoo-dev 2019-03-10 13:03:26 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37710f28851ba50ede07f1f5b9c0820a822d8ca2

commit 37710f28851ba50ede07f1f5b9c0820a822d8ca2
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-03-10 13:02:44 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-03-10 13:03:19 +0000

    sys-boot/syslinux: allow user patches, #662678
    
    Applying user patches will ease testing and debugging of #662678
    
    Bug: https://bugs.gentoo.org/662678
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-boot/syslinux/syslinux-6.04_pre1.ebuild | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 17 Andreas K. Hüttel archtester gentoo-dev 2019-03-24 21:50:44 UTC
Hi Piotr, 

https://salsa.debian.org/images-team/syslinux/tree/debian/master/debian/patches

it's probably best if we try to follow Debian...

Could you please try if applying patches 016, 017, and 018 from above URL helps?

We want to stabilize binutils-2.31.1 soon...

TIA
Comment 18 Chí-Thanh Christopher Nguyễn gentoo-dev 2019-03-24 22:44:19 UTC
Patch 016 is about mbr.bin which is not used for booting UEFI systems
Patch 017 is the one in comment #12
Patch 018 addresses gcc-8.2.0 build issue, and is unrelated to binutils AFAICT

I still didn't get feedback from the reporter about the patch in comment #15.
Comment 19 Piotr Karbowski (RETIRED) gentoo-dev 2019-03-24 23:05:46 UTC
Tomorrow I will check those patches as well as test gentoo built amd64 syslinux just to be sure that it works.
Comment 20 Piotr Karbowski (RETIRED) gentoo-dev 2019-03-25 21:35:41 UTC
Hi,

I just tried the syslinux.efi build with the two attached patches here, and another build with the tree Debian patches.

None of the syslinux.efi worked.
Comment 21 Piotr Karbowski (RETIRED) gentoo-dev 2019-03-25 21:43:41 UTC
I just fetched stable stage3 and simply did `emerge-webrsync && emerge syslinux'. After that I've taken syslinux.efi from there and I can confirm that the syslinux currently built in stable gentoo works, while the one built on ~amd64 does not work, regardless of patches here.
Comment 22 Piotr Karbowski (RETIRED) gentoo-dev 2019-03-25 21:46:27 UTC
I'd like to ask you to try to reproduce it on your end. I can reproduce it on every single of my systems, both AMD and Intel.

There are steps to reproduce in first comment, and the whole process is rather quick, if one have access to 2nd UEFI-enabled system. If the menu (vesamenu.c32) show anything -- it works, if it reboots or hang on black screen -- its broken.
Comment 23 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-25 21:48:17 UTC
(In reply to Piotr Karbowski from comment #21)
> I just fetched stable stage3 and simply did `emerge-webrsync && emerge
> syslinux'. After that I've taken syslinux.efi from there and I can confirm
> that the syslinux currently built in stable gentoo works, while the one
> built on ~amd64 does not work, regardless of patches here.

Can you attach both working and nonworking .efi files?
Comment 24 Ben Kohler gentoo-dev 2019-03-26 12:56:10 UTC
I tested this on a new stable amd64 chroot.  Out of the box I can build a working syslinux.efi.  After upgrading to binutils-2.31.1-r4, the next syslinux.efi build is broken.  But then I applied the patch from comment 12 and can produce a working build.

However, on a full unstable amd64 box, the patch from comment 12 isn't enough to produce a working syslinux.efi... there must be some other breakage going on, in addition to the binutils thing.
Comment 25 Andreas K. Hüttel archtester gentoo-dev 2019-03-26 21:11:54 UTC
(In reply to Ben Kohler from comment #24)
> I tested this on a new stable amd64 chroot.  Out of the box I can build a
> working syslinux.efi.  After upgrading to binutils-2.31.1-r4, the next
> syslinux.efi build is broken.  But then I applied the patch from comment 12
> and can produce a working build.
> 
> However, on a full unstable amd64 box, the patch from comment 12 isn't
> enough to produce a working syslinux.efi... there must be some other
> breakage going on, in addition to the binutils thing.

OK but that means, if we add the patch from comment 12, then binutils-2.31.1-r4 can go stable.

(Still the rest will need to be debugged of course.)
Comment 26 Andreas K. Hüttel archtester gentoo-dev 2019-03-29 21:47:33 UTC
(In reply to Andreas K. Hüttel from comment #25)
> (In reply to Ben Kohler from comment #24)
> > I tested this on a new stable amd64 chroot.  Out of the box I can build a
> > working syslinux.efi.  After upgrading to binutils-2.31.1-r4, the next
> > syslinux.efi build is broken.  But then I applied the patch from comment 12
> > and can produce a working build.
> > 
> > However, on a full unstable amd64 box, the patch from comment 12 isn't
> > enough to produce a working syslinux.efi... there must be some other
> > breakage going on, in addition to the binutils thing.
> 
> OK but that means, if we add the patch from comment 12, then
> binutils-2.31.1-r4 can go stable.
> 
> (Still the rest will need to be debugged of course.)

Ping, after discussion on IRC, could we add that patch pretty please?
Chris, do you want to do that, should I do it for base-system, or do you want to wait some more?
Comment 27 Chí-Thanh Christopher Nguyễn gentoo-dev 2019-04-03 18:45:03 UTC
Feel free to apply this patch.
Comment 28 Larry the Git Cow gentoo-dev 2019-04-03 19:53:29 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6984c3b42ceaa152b76a10d284cbd4bbd9de8ba0

commit 6984c3b42ceaa152b76a10d284cbd4bbd9de8ba0
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2019-04-03 19:53:04 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2019-04-03 19:53:22 +0000

    sys-boot/syslinux: Add binutils-2.32 compatibility patch, bug 662678
    
    This is 0017-single-load-segment.patch from Debian
    
    Bug: https://bugs.gentoo.org/662678
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 .../syslinux-6.04_pre1-singleloadsegment.patch     | 304 +++++++++++++++++++++
 sys-boot/syslinux/syslinux-6.04_pre1.ebuild        |   1 +
 2 files changed, 305 insertions(+)
Comment 29 Andreas K. Hüttel archtester gentoo-dev 2019-04-03 19:54:07 UTC
> 
>     sys-boot/syslinux: Add binutils-2.32 compatibility patch, bug 662678
>     

Arrgh, sorry for the typo. 2.31 of course.
Comment 30 Sergei Trofimovich (RETIRED) gentoo-dev 2019-04-03 20:34:53 UTC
I also suggest reporting the bug upstream.
Comment 31 Thibaud CANALE 2020-09-13 14:11:22 UTC
Created attachment 660036 [details]
sys-boot/syslinux-6.04_pre1-r2 build log gzip-ed

Hello,

I noticed this issue because I met the same bug while I was under the 6.04_pre1 version of the sys-boot/syslinux ebuild, before the commit "6984c3b42ceaa152b76a10d284cbd4bbd9de8ba0"[1] (no bump revision, so my system didn’t get the update, "Tue Jan 30 14:59:37 2018" from genlop).

How to reproduce:
I now use the last ebuild version, 6.04_pre1-r2, and did a full reset of my boot device:
- create new GPT table, with EF00 flag for the new partition (I even wrote 512+1 MiB from /dev/zero at the root of the device before),
- format the partition with FAT32 FS,
- copy the current new /usr/share/syslinux/efi64 folder and its content directly as the ${DEVICE_MOUNT_PATH}/efi/boot directory,
- rename syslinux.efi to bootx64.efi,
- provide my syslinux.cfg configuration under the same directory,
- and finally put my personal files, kernel and initramfs, under ${DEVICE_MOUNT_PATH}/efi/gentoo.
- umount and reboot.

Here is the current file after emerge:
> # ll /usr/share/syslinux/efi64/syslinux.efi /mnt/usb/efi/boot/bootx64.efi 
> -rwxr-x--- 1 root root 176144 Sep 13 14:30 /mnt/usb/efi/boot/bootx64.efi*
> -rwxr-xr-x 1 root root 176144 Sep 13 14:30 /usr/share/syslinux/efi64/syslinux.efi*
> # sha256sum /usr/share/syslinux/efi64/syslinux.efi /mnt/usb/efi/boot/bootx64.efi 
> 62c79b0634762a94ff0f42daf7aef8f644667ff6793176d10062dd69afb89056  /usr/share/syslinux/efi64/syslinux.efi
> 62c79b0634762a94ff0f42daf7aef8f644667ff6793176d10062dd69afb89056  /mnt/usb/efi/boot/bootx64.efi

When I try to boot, it loads both the kernel and the initrd file, then it freezes, exactly the same behaviour before the update.

I provide as attachment the build log (gzip-ed), where we see it has applied the three current patches.

Thanks for support,

1: https://gitweb.gentoo.org/repo/gentoo.git/commit/sys-boot/syslinux?id=6984c3b42ceaa152b76a10d284cbd4bbd9de8ba0
Comment 32 Thibaud CANALE 2020-09-15 13:22:07 UTC
Ok my bad, I found the issue, it was inside my kernel, I had one faulty (activated) option which causes display issue (no output at all) only on UEFI system, but not under BIOS: X86_SYSFB.

I noticed I had a previous working kernel (not exactly working, it was lacking support for NVMe drivers, but unrelated to this issue), this one didn’t have this option.
After reading its help entry, I understood I had to activate another option: FB_SIMPLE. Not sure if it was enough but in case I also activated options FB_VESA and FB_EFI.

Now I have a kernel working on both syslinux and systemd-boot (previously known as gummiboot).

Sorry for the noise.