Opened 5 years ago

Closed 5 years ago

#58469 closed defect (fixed)

pdftk @2.02_0+gcc5 calls abort() with symbol __darwin10_Unwind_FindEnclosingFunction not found on 10.14 (since gcc9 @9.1.0?); pdftk build also broken because gcj-mp-5 (from gcc5 @5.5.0_4) abort()s in the same way; likely all else built with gcj also affected

Reported by: markmentovai (Mark Mentovai) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: someuser12, fhgwright (Fred Wright), dliessi (Davide Liessi)
Port: pdftk

Description

Port pdftk @2.02_0+gcc5 is broken on macOS 10.14 (and presumably all macOS since 10.7). It was built using gcj-mp-5 from port gcc5, and its runtime library libgcj.16.dylib references a symbol, __darwin10_Unwind_FindEnclosingFunction, expected to be provided by libgcc_s.1.dylib.

% qpdf --empty out1.pdf
% qpdf --empty out2.pdf
% pdftk out1.pdf out1.pdf2 output out.pdf
dyld: _dyld_bind_fully_image_containing_address() error
dyld: Symbol not found: __darwin10_Unwind_FindEnclosingFunction
  Referenced from: /opt/local/lib/gcc5/libgcj.16.dylib
  Expected in: /opt/local/lib/libgcc/libgcc_s.1.dylib
 in /opt/local/lib/gcc5/libgcj.16.dylib
zsh: abort      pdftk out1.pdf out1.pdf2 output out.pdf

Since macports-ports ac5a416fd8dc, libgcc_s.1.dylib is provided by port libgcc9 @9.1.0 on macOS 10.7 and later. GCC 9 no longer offers __darwin10_Unwind_FindEnclosingFunction in libgcc_s.1.dylib. This is a change in upstream GCC as of gcc 738b5536dcf3. __darwin10_Unwind_FindEnclosingFunction is now provided by d10-uwfef.o. But gcj-mp-5 from port gcc5, which built pdftk, doesn’t know to look for it.

In addition, I attempted to build pdftk from source:

% sudo port install -s pdftk

But the build fails when gcj-mp-5 calls abort() on failing to resolve the same symbol. A snippet from the build log:

:info:build Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/pdftk" && /usr/bin/make -w all -f Makefile.OSX-10.6 VERSUFF=-mp-5 
:debug:build system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/pdftk" && /usr/bin/make -w all -f Makefile.OSX-10.6 VERSUFF=-mp-5 
:info:build make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/pdftk'
:info:build /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile -iC /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/pdftk/../java all
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/java'
:info:build /opt/local/bin/gcj-mp-5 -Wall -fsource=1.3 -O2 --encoding=UTF-8 --classpath="/opt/local/share/java/libgcj-5.5.0.jar:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/java:." -C pdftk/com/lowagie/text/Anchor.java
:info:build dyld: _dyld_bind_fully_image_containing_address() error
:info:build dyld: Symbol not found: __darwin10_Unwind_FindEnclosingFunction
:info:build   Referenced from: /opt/local/lib/gcc5/libgcj.16.dylib
:info:build   Expected in: /opt/local/lib/gcc5/libgcc_s.1.dylib
:info:build  in /opt/local/lib/gcc5/libgcj.16.dylib
:info:build gcj-mp-5: internal compiler error: Abort trap: 6 (program ecj1)
:info:build Please submit a full bug report,
:info:build with preprocessed source if appropriate.
:info:build See <https://trac.macports.org/newticket> for instructions.
:info:build make[1]: [pdftk/com/lowagie/text/Anchor.class] Error 4 (ignored)
[…]
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_textproc_pdftk/pdftk/work/pdftk-2.02-dist/pdftk" && /usr/bin/make -w all -f Makefile.OSX-10.6 VERSUFF=-mp-5 
:info:build Exit code: 2
:error:build Failed to build pdftk: command execution failed
:debug:build Error code: CHILDSTATUS 42718 2

Change History (13)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Owner: set to ryandesign
Port: gcc5 removed
Status: newassigned

comment:2 Changed 5 years ago by kencu (Ken)

same issue on 10.6.8 with gcj now (if using libgcc9, at least).

There is a very similar function in the current library:

$ nm /opt/local/lib/libgcc/libgcc_s.1.dylib | grep FindEnclosing
000000000000a067 T __Unwind_FindEnclosingFunction

and see <http://gcc.1065356.n8.nabble.com/darwin10-Unwind-FindEnclosingFunction-td782236.html>

Last edited 5 years ago by kencu (Ken) (previous) (diff)

comment:3 Changed 5 years ago by markmentovai (Mark Mentovai)

Here’s one way to fix it: macports-ports pull request 4309.

comment:4 Changed 5 years ago by nakatamaho (NAKATA Maho)

BTW: there is an alternative to pdftk. pdftk-java https://gitlab.com/pdftk-java/pdftk thanks

comment:5 Changed 5 years ago by mouse07410 (Mouse)

Strongly recommend upgrading this port to gcc9.

comment:6 Changed 5 years ago by kencu (Ken)

can't. gcj was dropped long ago, and the last we have it is gcc5.

comment:7 Changed 5 years ago by mouse07410 (Mouse)

can't. gcj was dropped long ago, and the last we have it is gcc5.

Ouch...

How much of gcj functionality does pdftk actually use? Is it feasible to retrofit/reincarnate the missing capabilities to gcc9/gcc10? I don't think the whole gcj is needed???

comment:8 Changed 5 years ago by someuser12

Cc: someuser12 added

comment:9 in reply to:  4 Changed 5 years ago by someuser12

Replying to nakatamaho:

BTW: there is an alternative to pdftk. pdftk-java https://gitlab.com/pdftk-java/pdftk

Many thanks for pointing this. I submitted a Portfile proposal for pdftk-java in #58757.

comment:10 Changed 5 years ago by fhgwright (Fred Wright)

Cc: fhgwright added

comment:11 Changed 5 years ago by fhgwright (Fred Wright)

I don't think "normal" priority is appropriate when something that used to work is now completely broken.

comment:12 Changed 5 years ago by dliessi (Davide Liessi)

Cc: dliessi added

comment:13 Changed 5 years ago by markmentovai (Mark Mentovai)

Resolution: fixed
Status: assignedclosed

In e9f48ba8719d3752218b65b6893c002d5ef7cd6a/macports-ports (master):

gcc5: libgcj compatibility with libgcc9

libgcc_s.1.dylib formerly provided
darwin10_Unwind_FindEnclosingFunction, but this is no longer true as
of GCC 9.1.0. This symbol is used by libgcj, and its absence causes the
compiler gcj-mp-5 and ports that are built by gcj to abort on any
attempted call. Provide a hidden definition in gcc5's libgcj.16.dylib
for libgcj's own use.

gcc5 is the most recent MacPorts GCC port to provide gcj.

Closes: #58469

Note: See TracTickets for help on using tickets.