stefson / gentoo-extras

GNU General Public License v3.0
1 stars 0 forks source link

musl-powered rust playground #1

Open stefson opened 2 years ago

stefson commented 2 years ago

@ernsteiswuerfel I pushed 1.52.1 and 1.53.0

please always make a backup with quickpkg once you went up one version successfully, and please never ever use +system-llvm, you can end up in horrible and maybe unfixable circular dependency situations.

with 1.53.0 you can compile librsvg-2.52.5, firefox-96.0 and eapi8 ebuilds such as cbindgen, it seems to be a good base for now untill I figured out what to do with patch 0005-Use-static-native-libraries-when-linking-static-exec.patch for rust-1.54.0

the in tree dev-lang/rust-1.58.1 ebuild has a dist useflag, where it seems to be possible to emerge it with a freshly packed stage2 archive: Install dist tarballs (used for bootstrapping) so maybe its possible to use that for getting fresh llvm-13 based stages nativly build

ernsteiswuerfel commented 2 years ago

Thanks! Updating to 1.53 worked flawlessly on ppc64. cbindgen and Firefox ESR are still buildable, did not try firefox-96.0 yet.

librsvg-2.52.5 fails however. librsvg-2.52.5:20220323-134919.log

stefson commented 2 years ago

you can try this fix from alpine: 0001-fixup-system-deps-targets.patch.zip

ernsteiswuerfel commented 2 years ago

The patch worked librsvg-2.52.5 built fine, thanks!

ernsteiswuerfel commented 2 years ago

@stefson Fiddled around with the ppc build a bit. Turned out I needed only this small patch to make it build: https://github.com/void-ppc/void-packages/blob/master/srcpkgs/rust/patches/fix-ppc32.patch

It did not apply on rust-1.49.0::smaeul but this was easy to fix. Bootstrapping from 1.49.0 working fine so far with the patch. 1.50.0 done and 1.51.0 in the works. 🥳 fix-ppc32.patch.zip

ernsteiswuerfel commented 2 years ago

Ok, so btootstrapping up to 1.53.0 worked well with the patch on ppc32. Next I was hoping to build librsvg-2.52.5 on ppc but this failed. librsvg-2.52.5:20220402-222802.log

Building librsvg-2.52.7 on ppc musl on the other hand succeeds. librsvg-2.52.7:20220402-223533.log

stefson commented 2 years ago

I need the output of rustc -Vv and gcc -v from the powerpc-musl

ernsteiswuerfel commented 2 years ago
 # rustc -Vv
rustc 1.53.0
binary: rustc
commit-hash: unknown
commit-date: unknown
host: powerpc-gentoo-linux-musl
release: 1.53.0
LLVM version: 12.0.1

 # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc-gentoo-linux-musl/11.2.1/lto-wrapper
Target: powerpc-gentoo-linux-musl
Configured with: /var/tmp/portage/sys-devel/gcc-11.2.1_p20220115/work/gcc-11-20220115/configure --host=powerpc-gentoo-linux-musl --build=powerpc-gentoo-linux-musl --prefix=/usr --bindir=/usr/powerpc-gentoo-linux-musl/gcc-bin/11.2.1 --includedir=/usr/lib/gcc/powerpc-gentoo-linux-musl/11.2.1/include --datadir=/usr/share/gcc-data/powerpc-gentoo-linux-musl/11.2.1 --mandir=/usr/share/gcc-data/powerpc-gentoo-linux-musl/11.2.1/man --infodir=/usr/share/gcc-data/powerpc-gentoo-linux-musl/11.2.1/info --with-gxx-include-dir=/usr/lib/gcc/powerpc-gentoo-linux-musl/11.2.1/include/g++-v11 --with-python-dir=/share/gcc-data/powerpc-gentoo-linux-musl/11.2.1/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --disable-nls --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 11.2.1_p20220115 p4' --disable-esp --enable-libstdcxx-time --with-build-config=bootstrap-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-multilib --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --disable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --enable-lto --without-isl --disable-libsanitizer --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20220115 (Gentoo 11.2.1_p20220115 p4)
stefson commented 2 years ago

I did some research about this and learned that powerpc simply doesn't have AtomicI64 support, neither gnu based nor musl based rustc. Some crates work around it, others don't, but custom targets such as all of our musl based ones need to intervene here manually.

Try this approach please, its the least invasive:

diff --git a/.cargo/config b/.cargo/config
index a94e912..ccf8ea3 100644
--- a/.cargo/config
+++ b/.cargo/config
@@ -9,3 +9,6 @@ replace-with = 'vendored-sources'

 [source.vendored-sources]
 directory = './vendor'
+
+[target.powerpc-gentoo-linux-musl]
+rustflags = ["--cfg", "crossbeam_no_atomic_64"]

its against librsvg-2.52.5, please drop into /etc/portage/patches and report back

ernsteiswuerfel commented 2 years ago

With this patch librsvg-2.52.5 built without problems. Thanks!

stefson commented 2 years ago

I stole the idea from here: https://github.com/crossbeam-rs/crossbeam/issues/731 , it might happen again for cargo-c or any other ebuild that uses the crossbeam crates, and the fix would be similar.

An alternative is to export as RUSTFLAG through /etc/portage/make.conf or on a per package based env file in /etc/portage/env/

stefson commented 2 years ago

I pushed rust-1.54.0 for you. please report back with positive and negative feedback.

you will need the updated patch for librsvg-2.52.6: 0001-fixup-system-deps-targets.patch.gz

stefson commented 2 years ago

1.53.0 at work:

firefox-91 7 1

ernsteiswuerfel commented 2 years ago

I pushed rust-1.54.0 for you. please report back with positive and negative feedback.

* Applying 0016-fix-ppc32.patch ...
patching file src/bootstrap/builder.rs
Hunk #1 FAILED at 1299.

You need to take my modified version, the original one would not apply (see my comment above).

stefson commented 2 years ago

I see, the merge window of the underlying change is between 1.55.0 and 1.57.0; before that it has to be backported. It was a blind shot, because I'm a bit ahead of publishing the ebuilds here and the ebuild won't let me src_prepare without a useable system-rust lol

//edit: underlying change is merged in 1.56.1

ernsteiswuerfel commented 2 years ago

Ok, rust-1.54.0 and librsvg-2.52.6 built fine on ppc64. 🥳 ppc coming up next...

ernsteiswuerfel commented 2 years ago

Success on ppc too with rust-1.54.0 and librsvg-2.52.6!

stefson commented 2 years ago

I pushed 1.55.0 and 1.56.1, hopefully I didn't mess up the ppc32 patch again :rofl:

1.56.1 is llvm13 based, with it you can emerge librsvg-2.54.0

please test and report back

ernsteiswuerfel commented 2 years ago

1.56.1 upgrade went flawless on ppc64. It did not build librsvg-2.54.0 however: librsvg-2.54.0:20220406-103703.log

I'll try ppc32 next.

stefson commented 2 years ago

you forgot to forward the patch, its still needed.

ernsteiswuerfel commented 2 years ago

Oops... Yes, with the patch librsvg-2.54.0 builds fine!

Btw. could you add rust-1.48.0 and 1.49.0 from smaeuls overlay to yours? This way interested users could bootstrap up to 1.56.1 without the need of installing 2 overlays. Would be more convenient.

stefson commented 2 years ago

honestly I'm more interested into getting the powerpc issue fixed upstream.

Do you still have the failed build log available? I forgot where you mentioned it for the first time.

ernsteiswuerfel commented 2 years ago

I think you mean this thread: https://github.com/gentoo/musl/pull/366#issuecomment-1052318916

stefson commented 2 years ago

the ppc32 patch only extends the whitelist to include powerpcle-* targets; but you are not on little endian, are you? could be helpfull for me if you shared the output of cpuid with me.

ernsteiswuerfel commented 2 years ago

No, i have all my PPC machines on BE. The Talos II which I booted into the ppc32 G4 partition (to build 1.55.0 and 1.56.1 right now) shows this data:

 # lscpu 
Architecture:          ppc64
  CPU op-mode(s):      32-bit, 64-bit
  Byte Order:          Big Endian
CPU(s):                32
  On-line CPU(s) list: 0-31
Model name:            POWER9, altivec supported
  Model:               2.2 (pvr 004e 1202)
  Thread(s) per core:  4
  Core(s) per socket:  4
  Socket(s):           2
Caches (sum of all):   
  L1d:                 256 KiB (8 instances)
  L1i:                 256 KiB (8 instances)
  L2:                  4 MiB (8 instances)
  L3:                  80 MiB (8 instances)
NUMA:                  
  NUMA node(s):        2
  NUMA node0 CPU(s):   0-15
  NUMA node8 CPU(s):   16-31
Vulnerabilities:       
  Itlb multihit:       Not affected
  L1tf:                Mitigation; RFI Flush, L1D private per thread
  Mds:                 Not affected
  Meltdown:            Mitigation; RFI Flush, L1D private per thread
  Spec store bypass:   Mitigation; Kernel entry/exit barrier (eieio)
  Spectre v1:          Mitigation; __user pointer sanitization, ori31 speculation barrier enabled
  Spectre v2:          Mitigation; Indirect branch serialisation (kernel only)
  Srbds:               Not affected
  Tsx async abort:     Not affected

 # emerge --info
Portage 3.0.30 (python 3.10.2-final-0, default/linux/ppc/17.0/musl, gcc-11.2.1, musl-1.2.2-r7, 5.16.18-gentoo-P9 ppc64)
=================================================================
System uname: Linux-5.16.18-gentoo-P9-ppc64-POWER9,_altivec_supported-with-libc
KiB Mem:    65807424 total,  49164004 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 06 Apr 2022 09:30:01 +0000
Head commit of repository gentoo: 127654ee62e16c459cb47c283df0dc5b3a8db0ab
Head commit of repository gentoo-extras: 97fd35405fdc890edeeead46f80cdf9e96a06eb7

Timestamp of repository musl: Tue, 05 Apr 2022 17:35:31 +0000
Head commit of repository musl: d3ddfddb4594435678043031a6f77493cc488f58

Timestamp of repository smaeul: Tue, 05 Apr 2022 17:35:58 +0000
Head commit of repository smaeul: 0c85f2840730b4d273121f0e17979bf5f5854586

sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
distcc 3.4 powerpc-gentoo-linux-musl [disabled]
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           3.9.10_p1::gentoo, 3.10.2_p1::gentoo
dev-lang/rust:             1.54.0::gentoo-extras
dev-util/cmake:            3.22.2::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.4::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.2.1_p20220115::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/llvm:            13.0.1::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.2-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://yea/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 2
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 24

gentoo-extras
    location: /var/db/repos/gentoo-extras
    sync-type: git
    sync-uri: https://github.com/stefson/gentoo-extras
    masters: gentoo

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo

musl
    location: /var/db/repos/musl
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/musl.git
    masters: gentoo

smaeul
    location: /var/db/repos/smaeul
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/smaeul.git
    masters: gentoo

ACCEPT_KEYWORDS="ppc"
ACCEPT_LICENSE="*"
CBUILD="powerpc-gentoo-linux-musl"
CFLAGS="-Os -mcpu=7450 -mtune=7450 -pipe"
CHOST="powerpc-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-Os -mcpu=7450 -mtune=7450 -pipe"
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="-Os -mcpu=7450 -mtune=7450 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-Os -mcpu=7450 -mtune=7450 -pipe"
GENTOO_MIRRORS="ftp://ftp.gwdg.de/pub/linux/gentoo ftp://ftp.fi.muni.cz/pub/linux/gentoo"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en de_DE"
MAKEOPTS="-j16 -l18"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BZIP2_COMMAND="pbzip2"
PORTAGE_COMPRESS="zstd"
PORTAGE_COMPRESS_FLAGS="-6"
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"
SHELL="/bin/bash"
USE="X a52 aac acl alsa big-endian bluetooth brotli bzip2 cairo caja cdda cli colord crypt cryptsetup css cups dav1d dbus djvu dri dvd elogind enca exif filecaps flac fortran gtk gtk3 gui iconv icu introspection ipv6 jpeg lcms libglvnd libnotify lm-sensors mmap mng mp3 mtp ncurses networkmanager nls nptl nss ogg opengl openmp opus pam pcre pdf png policykit ppc pulseaudio qt5 raw readline seccomp smp spell split-usr ssl svg system-icu system-sqlite threads tiff truetype udev udisks unicode upower vorbis vpx webp widgets xattr xml xmp xxhash zlib zstd" ADA_TARGET="gnat_2020" 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_PPC="altivec" ELIBC="musl" 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" GRUB_PLATFORMS="ieee1275" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU" LUA_SINGLE_TARGET="lua5-3" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="fbdev r300 radeon" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
stefson commented 2 years ago

given by the information you gave me, this should be sufficent to fix your problem:

--- a/src/bootstrap/builder.rs  2022-03-14 12:57:04.942958375 +0100
+++ b/src/bootstrap/builder.rs  2022-04-01 17:42:59.631219179 +0200
@@ -1212,7 +1212,7 @@
         // efficient initial-exec TLS model. This doesn't work with `dlopen`,
         // so we can't use it by default in general, but we can use it for tools
         // and our own internal libraries.
-        if !mode.must_support_dlopen() {
+        if !mode.must_support_dlopen() && !target.triple.starts_with("powerpc-") {
             rustflags.arg("-Ztls-model=initial-exec");
         }

which is the original patch: https://github.com/rust-lang/rust/commit/283619cf5ca25272b294525273ec42e9c7820edb

the patch used right now merely extends the target.triple to powerpcle, but your system should not take notice of that. I could be wrong though, don't have any hardware to test.

ernsteiswuerfel commented 2 years ago

True. I successfully built 1.56.1 on ppc with the ppc32 patch disabled. I think the versions before still need the (original) patch.

The powerpcle target triple is Void Linux only AFAIK and that's where I got the patch from. They are about to create a ppc32 LE version of their distro. Don't know what's the working state of it however. ppc64 LE is rather common I guess. But ppc64 LE does not seem to need this patch? Don't have any PPC box on LE so I can't tell.

librsvg-2.54.0 builds on ppc32 too, so all good. 😄

stefson commented 2 years ago

@ernsteiswuerfel I pushed 1.57.0 to the overlay, this is enough to build you nice firefox-99.0 and firefox-100.0 beta if you feel like testing them.

stefson commented 2 years ago

1.58.1 at work:

firefox-98 0 2-musl

stefson commented 2 years ago

hint: webrtc is horribly broken with the last update in firefox-94.0 on any arch except amd64, arm64 and x86 I believe. Simply pass additional --disable-webrtc

ernsteiswuerfel commented 2 years ago

Meanwhile I upgraded toolchain to musl-1.2.3 and binutils-2.38-r1 (+ gcc-11.2.1_p20220115 as before) on ppc64. And I am on your rust-1.58.1 now. rust-1.57 did not build with binutils-2.38-r1 (see logfile), I needed to use binutils-2.37_p1-r2. rust-1.57.0:20220414-101217.log.gz

Did not build any of the new Firefox versions yet, only ESR.

stefson commented 2 years ago

you need to report that bug to binutils upstream bugtracker at sourceware.org/bugzilla, there are various pullrequests concerning assertion failures of llvm, as well as them being reverted for introducing regressions recently.

stefson commented 2 years ago

@ernsteiswuerfel if you ever get stuck again, here is how to bootstrap yourself a new rustc-stage through cross compile: https://wiki.gentoo.org/wiki/User:Sam/Drafts/Bootstrapping_Rust_cross

ernsteiswuerfel commented 1 year ago

Thanks for the hint! Always good do know as a last resort. 😉

However after mimicking my ppc64-musl settings closely on my ppc32-musl setup and rebuilding world afterwards my issues with binutils-2.38 & rust are gone. I am happily on rust-1.59.0 from your overlay on ppc32 now. 🥳

stefson commented 1 year ago

lovely to see it working, I plan to push out updates once rustc is not recent enough anymore to compile latest stable firefox. If I somehow manage to miss it please ping me here.

stefson commented 1 year ago

@ernsteiswuerfel are you able to compile firefox-103.0.2 with gcc and the musl-powered rust-1.59.0? I'm running into linking errors:

305:31.61 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: /var/tmp/portage/www-client/firefox-103.0.2/work/firefox_build/toolkit/library/build/../../../layout/printing/Unified_cpp_layout_printing0.o: in function `nsPrintJob::GetIsEmpty() const':
305:31.61 Unified_cpp_layout_printing0.cpp:(.text._ZNK10nsPrintJob10GetIsEmptyEv+0x7c): undefined reference to `nsPageSequenceFrame::GetPagesInFirstSheet() const'
305:31.61 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: /var/tmp/portage/www-client/firefox-103.0.2/work/firefox_build/toolkit/library/build/../../../layout/printing/Unified_cpp_layout_printing0.o: in function `nsPrintJob::PrePrintSheet()':
305:31.61 Unified_cpp_layout_printing0.cpp:(.text._ZN10nsPrintJob13PrePrintSheetEv+0x7c): undefined reference to `nsPageSequenceFrame::PrePrintNextSheet(nsITimerCallback*, bool*)'
305:31.61 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: /var/tmp/portage/www-client/firefox-103.0.2/work/firefox_build/toolkit/library/build/../../../layout/printing/Unified_cpp_layout_printing0.o: in function `nsPrintJob::PrintSheet(nsPrintObject*, bool&)':
305:31.62 Unified_cpp_layout_printing0.cpp:(.text._ZN10nsPrintJob10PrintSheetEP13nsPrintObjectRb+0x240): undefined reference to `nsPageSequenceFrame::PrintNextSheet()'
305:31.62 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: Unified_cpp_layout_printing0.cpp:(.text._ZN10nsPrintJob10PrintSheetEP13nsPrintObjectRb+0x258): undefined reference to `nsPageSequenceFrame::DoPageEnd()'
305:31.62 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: /var/tmp/portage/www-client/firefox-103.0.2/work/firefox_build/toolkit/library/build/../../../layout/printing/Unified_cpp_layout_printing0.o: in function `nsPrintJob::DoPrint(mozilla::UniquePtr<nsPrintObject, mozilla::DefaultDelete<nsPrintObject> > const&)':
305:31.62 Unified_cpp_layout_printing0.cpp:(.text._ZN10nsPrintJob7DoPrintERKN7mozilla9UniquePtrI13nsPrintObjectNS0_13DefaultDeleteIS2_EEEE+0x284): undefined reference to `nsPageSequenceFrame::StartPrint(nsPresContext*, nsIPrintSettings*, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&)'
305:31.62 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: /var/tmp/portage/www-client/firefox-103.0.2/work/firefox_build/toolkit/library/build/../../../layout/printing/Unified_cpp_layout_printing0.o: in function `nsPrintJob::SetupToPrintContent()':
305:31.62 Unified_cpp_layout_printing0.cpp:(.text._ZN10nsPrintJob19SetupToPrintContentEv+0x73c): undefined reference to `nsPageSequenceFrame::StartPrint(nsPresContext*, nsIPrintSettings*, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&)'
305:31.63 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: /var/tmp/portage/www-client/firefox-103.0.2/work/firefox_build/toolkit/library/build/../../../layout/printing/Unified_cpp_layout_printing0.o: in function `nsPrintJob::DonePrintingSheets(nsPrintObject*, nsresult)':
305:31.63 Unified_cpp_layout_printing0.cpp:(.text._ZN10nsPrintJob18DonePrintingSheetsEP13nsPrintObject8nsresult+0x6c): undefined reference to `nsPageSequenceFrame::ResetPrintCanvasList()'
305:31.63 /usr/lib/gcc/armv7a-unknown-linux-musleabihf/9.5.0/../../../../armv7a-unknown-linux-musleabihf/bin/ld.bfd: libxul.so: hidden symbol `_ZN19nsPageSequenceFrame9DoPageEndEv' isn't defined
ernsteiswuerfel commented 1 year ago

I would not expect to build it on ppc32 anyhow as it's broken on this arch for a long time... Last working Firefox on ppc32 was around FF 49.x or 52.x. or so.

On ppc64 FF 91.x builds fine but I am having trouble with FF 102.x. However ATM I am running rust::smaeul und not yours yet.

Anything specific I should check or try?

stefson commented 1 year ago

beginning with firefox-103 branch, I get linking errors from ld.bfd on armv7a - they are somewhat similar to https://bugs.gentoo.org/866293

other than the broken compile I don't have any issue with 103.0, and none with 102.0

you are welcome to share your logs, I will share mine in the next days when I get enough free cpu time to compile 103.0 again //Edit: I forgot that I posted the actuall error one post above your last one ;)

stefson commented 1 year ago

@ernsteiswuerfel I pushed rust-1.60.0 and rust-1.61.0 to the overlay, firefox-105.0 will need it.

ernsteiswuerfel commented 1 year ago

Sorry for it took me so long, but I was a bit occupied by testing out a ppc llvm bug and another clang bug. 😮‍💨

Tried rust-1.60.0 now (with system-bootstrap) but it didn't work out. Log attached. rust-1.60.0:20221012-130526.log

stefson commented 1 year ago

from the changelog of crossbeam-utils:

# Version 0.8.6

- Re-add `AtomicCell<{i,u}64>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0 on targets that do not support `Atomic{I,U}64`. (#767)
- Re-add `AtomicCell<{i,u}128>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0. (#767)

I believe this is the problem you're facing.

stefson commented 1 year ago

try this patch:

diff --git a/vendor/crossbeam-utils-0.8.6/no_atomic.rs b/vendor/crossbeam-utils-0.8.6/no_atomic.rs
index 7882c58..318482b 100644
--- a/vendor/crossbeam-utils-0.8.6/no_atomic.rs
+++ b/vendor/crossbeam-utils-0.8.6/no_atomic.rs
@@ -37,6 +37,7 @@ const NO_ATOMIC_64: &[&str] = &[
     "powerpc-unknown-linux-gnu",
     "powerpc-unknown-linux-gnuspe",
     "powerpc-unknown-linux-musl",
+    "powerpc-gentoo-linux-musl",
     "powerpc-unknown-netbsd",
     "powerpc-unknown-openbsd",
     "powerpc-wrs-vxworks",

it will make the compile fail with some checksum errors at first, please report the failed log back to me so I can patch the new checksum into the final patch. I can't roll back to rust-1.60.0 anymore.

ernsteiswuerfel commented 1 year ago

Thanks! Here's the new log with your patch. rust-1.60.0:20221012-221717.log

stefson commented 1 year ago

I pushed the supposed fix for 1.60.0 and 1.61.0 for now, please test and report back the results.

ernsteiswuerfel commented 1 year ago

1.60.0 built fine so far and successfully built librsvg.

stefson commented 1 year ago

ok great.

librsvg-2.55.1 will be troublesome since upstream decided to not vendor their crates themselves anymore - this means if one crate fails to compile the whole package will be broken beyond repair. At least it seems to be like that on a quick glance, as its impossible to patch the crates themselves.

ernsteiswuerfel commented 1 year ago

librsvg-2.55.1 will be troublesome since upstream decided to not vendor their crates themselves anymore - this means if one crate fails to compile the whole package will be broken beyond repair. At least it seems to be like that on a quick glance, as its impossible to patch the crates themselves.

Ok, good to know! I built librsvg-2.54.4 as this version is getting stabled on Gentoo.

Aaand rust-1.61.0 finished building too, everything seems ok. Thanks for your efforts!

stefson commented 1 year ago

yeah, its pretty bad as you can't repack the patched crate.

can you imagine to host a repacked librsvg version in the future, on your dev space? its pretty easy to repack, all you have to do is to copy all the unpacked crates into the vendor folder and compress it.

ernsteiswuerfel commented 1 year ago

Not really as I am neither a Gentoo Dev (arch tester only) nor I got dev space. 😉

stefson commented 1 year ago

can you give librsvg-2.55.1 a try on your setups? I'd like to know if it has any additional bugs

ernsteiswuerfel commented 1 year ago

Just gave it a try but did not get far as the AtomicU64 patch from earlier versions did not apply. librsvg-2.55.1:20221017-111808.log