Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 792528

Summary: app-text/mupdf-1.18.0-r4 cross-compile fails: /bin/sh: line 1: build/debug/scripts/hexdump.exe: cannot execute binary file: Exec format error
Product: Gentoo Linux Reporter: Bruno MATEU <mateubruno>
Component: Current packagesAssignee: Philipp Rösner <rndxelement>
Status: RESOLVED FIXED    
Severity: normal CC: cross, ionen, johu, proxy-maint, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log

Description Bruno MATEU 2021-05-27 16:59:32 UTC
Cross-compiling of app-text/mupdf-1.18.0-r4 fails when trying to execute "hexdump.exe" which is compiled for the target : 

build.log extract: 
mkdir -p build/debug/scripts/ ; aarch64-linux-gnu-gcc -mcpu=cortex-a53+sha2+aes+crc -O2 -pipe -fomit-frame-pointer -DFZ_ENABLE_JS=1 -ffunction-sections -fdata-sections -Wsign-compare -fPIC -Iinclude -o build/debug/scripts/hexdump.exe scripts/hexdump.c

I checked if the mupdf-1.18.0-cross-fixes.patch patch is correctly applied and it is, but looks like it is not working anymore...

Also this patch does not changes CFLAGS value for compiling hexdump.exe, it should use the CFLAGS_FOR_BUILD value to avoid crashes caused by target-specific flags sets in the CFLAGS variable.

# > emerge-aarch64-linux-gnu -pqv '=app-text/mupdf-1.18.0-r4::gentoo'                                                                         [ebuild  N    ] app-text/mupdf-1.18.0-r4 to /usr/aarch64-linux-gnu/ USE="X javascript opengl ssl"
Comment 1 Bruno MATEU 2021-05-27 17:00:41 UTC
Created attachment 711777 [details]
build log

# > emerge-aarch64-linux-gnu --info                      
Portage 3.0.18 (python 3.8.9-final-0, default/linux/arm64/17.0/desktop/plasma, gcc-10.2.0, glibc-2.33, 5.10.27-gentoo x86_64)
=================================================================
System uname: Linux-5.10.27-gentoo-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-glibc2.2.5
KiB Mem:    16268924 total,   3153452 free
KiB Swap:    8388604 total,   8211196 free
Timestamp of repository gentoo: Wed, 19 May 2021 15:30:01 +0000
Head commit of repository gentoo: 491eef4feb425f0b92186b0e8f43777d2bd949c9
sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 4.2.1 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          3.8.10_p1::gentoo
sys-apps/baselayout:      2.7-r2::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/binutils:       2.35.2::gentoo, 2.36.1-r1::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.12::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

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

britaliope
    location: /var/db/repos/britaliope
    masters: gentoo
    priority: 100
    eclass-overrides: britaliope

ACCEPT_KEYWORDS="arm64 ~arm64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mcpu=cortex-a53+sha2+aes+crc -O2 -pipe -fomit-frame-pointer"
CHOST="aarch64-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf"
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.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-mcpu=cortex-a53+sha2+aes+crc -O2 -pipe -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH 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"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9 -l0"
PKGDIR="/usr/aarch64-linux-gnu/packages/"
PORTAGE_CONFIGROOT="/usr/aarch64-linux-gnu/"
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="/usr/aarch64-linux-gnu/tmp/"
RUSTFLAGS="-C target-cpu=cortex-a53"
USE="X a52 aac aarch64 acl acpi activities alsa arm64 berkdb bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvdr elogind emboss encode exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 jpeg kde kipi kwallet lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt5 readline sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wayland widgets wxwidgets x264 xattr xcb xml xv xvid zlib" ADA_TARGET="gnat_2018" 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_ARM="edsp thumb thumb2 v4 v5 v6 v7 v8 vfp vfp-d32 vfpv3 vfpv4" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="fbdev dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Larry the Git Cow gentoo-dev 2022-06-20 02:58:59 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d68dc60d93eee90a3dd03d4b1ca902f2d0993d7

commit 9d68dc60d93eee90a3dd03d4b1ca902f2d0993d7
Author:     Philipp Rösner <rndxelement@protonmail.com>
AuthorDate: 2022-06-17 21:47:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-20 02:58:37 +0000

    app-text/mupdf: add 1.20.0
    
    Bug: https://bugs.gentoo.org/792528
    Signed-off-by: Philipp Rösner <rndxelement@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/25945
    Signed-off-by: Sam James <sam@gentoo.org>

 app-text/mupdf/Manifest            |   1 +
 app-text/mupdf/mupdf-1.20.0.ebuild | 153 +++++++++++++++++++++++++++++++++++++
 2 files changed, 154 insertions(+)