FS#72831 - [harfbuzz] build failure

Attached to Project: Arch Linux
Opened by T.J. Townsend (blakkheim) - Wednesday, 24 November 2021, 17:10 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 10 March 2022, 17:48 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I'm trying to build the harfbuzz package with an up-to-date Arch install, including the latest icu package. No makepkg.conf customizations in place.

The final line of the build shows:

/sbin/ld: /tmp/ccgBpG9y.ltrans0.ltrans.o:(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v
0]+0x0): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status
[101/265] Compiling C++ object src/test-vector.p/hb-static.cc.o
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
Aborting...
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 10 March 2022, 17:48 GMT
Reason for closing:  Fixed
Comment by T.J. Townsend (blakkheim) - Wednesday, 24 November 2021, 21:47 GMT
Using Clang/lld gives a similar error:


ld.lld: error: undefined symbol: __cxa_begin_catch
>>> referenced by ld-temp.o
>>> lto.tmp:(__clang_call_terminate)

ld.lld: error: undefined symbol: std::terminate()
>>> referenced by ld-temp.o
>>> lto.tmp:(__clang_call_terminate)

ld.lld: error: undefined symbol: __gxx_personality_v0
>>> referenced by ld-temp.o
>>> lto.tmp:(DW.ref.__gxx_personality_v0)
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
[74/265] Compiling C++ object src/libharfbuzz-subset.so.0.30101.0.p/hb-subset.cc.o
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
Comment by loqs (loqs) - Thursday, 25 November 2021, 00:01 GMT
If you remove -fexceptions from CFLAGS can you then build the package?
Edit:
https://github.com/harfbuzz/harfbuzz/blob/3.1.1/meson.build#L47
CXXFLAGS are applied last so exceptions are enabled

c++ -Isrc/libharfbuzz.so.0.30101.0.p -Isrc -I../harfbuzz/src -I. -I../harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -fno-rtti -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -fPIC -pthread -Wno-non-virtual-dtor -MD -MQ src/libharfbuzz.so.0.30101.0.p/hb-draw.cc.o -MF src/libharfbuzz.so.0.30101.0.p/hb-draw.cc.o.d -o src/libharfbuzz.so.0.30101.0.p/hb-draw.cc.o -c ../harfbuzz/src/hb-draw.cc
Comment by T.J. Townsend (blakkheim) - Thursday, 25 November 2021, 01:48 GMT
I removed -fexceptions from the (default) makepkg.conf and rebuilt. It works.

Building in a clean chroot as per the wiki also allows it to build.

https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot#Convenience_way
Comment by loqs (loqs) - Thursday, 25 November 2021, 03:40 GMT
CXXFLAGS="${CFLAGS/-fexceptions /} -Wp,-D_GLIBCXX_ASSERTIONS"
Also seems to work. -fexceptions is enabled implicitly for C++ so removing the explicit use of the options should have no effect apart from when -fno-exceptions is used.

Loading...