Bug 242745

Summary: editors/libreoffice: Fails to build on FreeBSD 12.1-RELEASE-p1 32 bit: lib/libuno_sal.so: undefined reference to `__atomic_*`
Product: Ports & Packages Reporter: canardo <canardo909>
Component: Individual Port(s)Assignee: freebsd-office mailing list <office>
Status: Open ---    
Severity: Affects Some People CC: jhibbits, pkubaj, powerpc
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (office)
koobs: merge-quarterly?
Hardware: powerpc   
OS: Any   

Description canardo 2019-12-20 19:45:36 UTC
Problem found when building editors/libreoffice on FreeBSD 12.1-RELEASE-p1 powerpc 32 bit, running on Apple Powerbook 17".


# cd /usr/ports/editors/libreoffice 
# make -DBATCH install clean
===>  Building for libreoffice-6.3.4
gmake[1]: Entering directory '/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2'
Automatic fetching of external tarballs is disabled.
mkdir -p /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/instdir
/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/solenv/bin/install-gdb-printers -a /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/instdir -c
gmake -j 1  -r -f /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/Makefile.gbuild  build  
gmake[2]: Entering directory '/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2'
[LNK] Executable/cppumaker
S=/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2 && I=$S/instdir && W=$S/workdir &&  g++9 -pthread    -Wl,-z,origin '-Wl,-rpath,$ORIGIN/../../program' -Wl,-rpath-link,$I/program -fstack-protector-strong -Wl,-rpath-link,/lib:/usr/lib -Wl,-z,combreloc  -Wl,--hash-style=gnu  -Wl,-Bsymbolic-functions -L$W/LinkTarget/StaticLibrary -L$I/sdk/lib  -L$I/program -L/usr/local/lib  -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc9 -L/usr/local/lib/gcc9    -L/usr/local/lib -R/usr/local/lib  $W/CxxObject/codemaker/source/cppumaker/cppumaker.o $W/CxxObject/codemaker/source/cppumaker/cppuoptions.o $W/CxxObject/codemaker/source/cppumaker/cpputype.o $W/CxxObject/codemaker/source/cppumaker/dependencies.o $W/CxxObject/codemaker/source/cppumaker/dumputils.o $W/CxxObject/codemaker/source/cppumaker/includes.o      -Wl,--start-group $W/LinkTarget/StaticLibrary/libcodemaker_cpp.a $W/LinkTarget/StaticLibrary/libcodemaker.a    -Wl,--end-group -Wl,--no-as-needed -lunoidllo -luno_salhelpergcc3 -luno_sal  -o $I/sdk/bin/cppumaker 
/usr/local/bin/ld: /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/instdir/sdk/lib/libuno_sal.so: undefined reference to `__atomic_load_8'
/usr/local/bin/ld: /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/instdir/sdk/lib/libuno_sal.so: undefined reference to `__atomic_store_8'
/usr/local/bin/ld: /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/instdir/sdk/lib/libuno_sal.so: undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
gmake[2]: *** [/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/codemaker/Executable_cppumaker.mk:10: /usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2/instdir/sdk/bin/cppumaker] Error 1
gmake[2]: Leaving directory '/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2'
gmake[1]: *** [Makefile:282: build] Error 2
gmake[1]: Leaving directory '/usr/ports/editors/libreoffice/work/libreoffice-6.3.4.2'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/editors/libreoffice
Comment 1 Justin Hibbits freebsd_committer 2019-12-24 15:56:49 UTC
This also affects powerpcspe.  I believe somewhere it needs to link against libatomic to get these symbols.  It *might* go away once we switch to clang, but only if clang automatically decides to add in libatomic to the linker line.