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 Team <office>
Status: Closed Unable to Reproduce    
Severity: Affects Some People CC: jhibbits, lwhsu, 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 freebsd_triage 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.
Comment 2 Li-Wen Hsu freebsd_committer freebsd_triage 2020-06-16 22:18:36 UTC
Does this still happen with 6.4.4 in the tree?
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2020-06-18 00:28:55 UTC
(In reply to Li-Wen Hsu from comment #2)
Yes, this issue is still present.
Comment 4 canardo 2020-10-05 14:02:33 UTC
Error still present when building LibreOffice 7.0.1.2 with FreeBSD 12.2-BETA1 r365618 GENERIC  powerpc

[LNK] Executable/cppumaker
S=/usr/ports/editors/libreoffice/work/libreoffice-7.0.1.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-7.0.1.2/instdir/sdk/lib/libuno_sal.so: undefined reference to `__atomic_load_8'
/usr/local/bin/ld: /usr/ports/editors/libreoffice/work/libreoffice-7.0.1.2/instdir/sdk/lib/libuno_sal.so: undefined reference to `__atomic_store_8'
/usr/local/bin/ld: /usr/ports/editors/libreoffice/work/libreoffice-7.0.1.2/instdir/sdk/lib/libuno_sal.so: undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
Comment 5 Piotr Kubaj freebsd_committer freebsd_triage 2021-03-24 16:30:54 UTC
(In reply to canardo from comment #4)
Please check on 13.0 or current.
Comment 6 canardo 2021-04-15 07:48:24 UTC
(In reply to Piotr Kubaj from comment #5)

In FreeBSD 13.0, libreoffice depends on curl, currently flagged as vulnerable

===>  curl-7.75.0 has known vulnerabilities:
curl-7.75.0 is vulnerable:
  curl -- TLS 1.3 session ticket proxy host mixup
  CVE: CVE-2021-22890

I will wait for curl fix and then try to build libreoffice.
Comment 7 canardo 2021-04-29 06:31:47 UTC
(In reply to Piotr Kubaj from comment #5)

Build successful on 13.0

# uname -a
FreeBSD g41713 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:40:01 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/powerpc.powerpc/sys/GENERIC  powerpc


# pkg info libreoffice
libreoffice-7.1.2.2_7
Name           : libreoffice
Version        : 7.1.2.2_7
Installed on   : Wed Apr 28 02:26:31 2021 CEST
Origin         : editors/libreoffice
Architecture   : FreeBSD:13:powerpc


I guess ticket can be closed.