Bug 223279 - devel/boost-libs fails to build on powerpc64 since update to 1.65.1
Summary: devel/boost-libs fails to build on powerpc64 since update to 1.65.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Office Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-27 14:26 UTC by Justin Hibbits
Modified: 2017-12-11 02:00 UTC (History)
2 users (show)

See Also:


Attachments
poudriere build log (232.20 KB, application/gzip)
2017-10-27 14:26 UTC, Justin Hibbits
no flags Details
config.log (51.14 KB, text/x-log)
2017-10-27 16:35 UTC, Justin Hibbits
no flags Details
Proposed fix (1002 bytes, patch)
2017-12-09 20:42 UTC, Justin Hibbits
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Hibbits freebsd_committer freebsd_triage 2017-10-27 14:26:35 UTC
Created attachment 187520 [details]
poudriere build log

boost-libs 1.65.1 introduces the stacktrace-addr2line library, which for some reason does not build on powerpc64 (no indication why).  The build succeeds, but the package fails because the library does not exist.  Log is attached.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-10-27 14:35:13 UTC
Comment on attachment 187520 [details]
poudriere build log

>    - addr2line builds         : no

Can you attach bin.v2/config.log located under WRKSRC?
Comment 2 Justin Hibbits freebsd_committer freebsd_triage 2017-10-27 16:35:33 UTC
Created attachment 187527 [details]
config.log

Scanning the log for addr2line, I came across the following giveaway:

gcc.compile.c++ bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/has_addr2line.o

    "g++6"   -O0 -fno-inline -Wall -g -fPIC -m64 -pipe -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc6 -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc6 -std=gnu++11 -pipe -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc6 -fno-strict-aliasing -DBOOST_ALL_NO_LIB=1  -I"." -c -o "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/has_addr2line.o" "libs/stacktrace/build/has_addr2line.cpp"

gcc.link bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe

    "g++6"    -o "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe" -Wl,--start-group "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/has_addr2line.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g -m64 

Jamfile</wrkdirs/usr/ports/devel/boost-libs/work/boost_1_65_1/libs/stacktrace/build>.mp_simple_run_action bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line.output

      bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe > bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line.output

/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.21 required by /wrkdirs/usr/ports/devel/boost-libs/work/boost_1_65_1/bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe not found
...failed Jamfile</wrkdirs/usr/ports/devel/boost-libs/work/boost_1_65_1/libs/stacktrace/build>.mp_simple_run_action bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line.output...


So, looks like it needs a -rpath somewhere...
Comment 3 Justin Hibbits freebsd_committer freebsd_triage 2017-12-09 20:42:24 UTC
Created attachment 188669 [details]
Proposed fix

This is not the nicest patch.  It touches Mk/bsd.gcc.mk (adds RPATH variable), but it does fix the build.  Probably needs an exprun at the minimum.
Comment 4 Justin Hibbits freebsd_committer freebsd_triage 2017-12-09 22:05:45 UTC
Adding Gerald since the patch touches bsd.gcc.mk
Comment 5 Jan Beich freebsd_committer freebsd_triage 2017-12-10 03:24:40 UTC
Comment on attachment 188669 [details]
Proposed fix

> +MAKE_ARGS+=	xdll-path=${RPATH}

Why not use ${_GCC_RUNTIME} directly? make(1) usually postpones variable expansion unless it's used in .if/.for conditionals or target dependencies.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2017-12-10 03:28:45 UTC
Comment on attachment 188669 [details]
Proposed fix

> +.if ${COMPILER_TYPE}==gcc

This should be CHOSEN_COMPILER_PATH in case USES=compiler switches from Clang to GCC or vice versa. Maybe also avoid .if conditional to get rid of immediate variable expansion e.g.,


  MAKE_ARGS+=	${MAKE_ARGS_${CHOSEN_COMPILER_PATH}}
  MAKE_ARGS_gcc=	xdll-path=${_GCC_RUNTIME}

After that .include line changes will no longer be required.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2017-12-10 03:34:04 UTC
(In reply to Jan Beich from comment #6)
Err, s/CHOSEN_COMPILER_PATH/CHOSEN_COMPILER_TYPE/ ;)
Comment 8 Justin Hibbits freebsd_committer freebsd_triage 2017-12-10 04:28:08 UTC
(In reply to Jan Beich from comment #5)

I was operating under the assumption that _-prefixed variables are intended to be private to the include file.  If that's not the general case, I'll gladly change it.
Comment 9 Jan Beich freebsd_committer freebsd_triage 2017-12-10 17:57:44 UTC
A number of ports already uses ${_GCC_RUNTIME}. While the use of internal variable is discouraged it's not forbidden given lack of better alternative. For one, USES=fortran has ${LOCALBASE}/lib/gcc${_GCC_VER} which is just as ugly.
Comment 10 commit-hook freebsd_committer freebsd_triage 2017-12-10 18:41:42 UTC
A commit references this bug:

Author: jbeich
Date: Sun Dec 10 18:40:51 UTC 2017
New revision: 455905
URL: https://svnweb.freebsd.org/changeset/ports/455905

Log:
  devel/boost-libs: pass RPATH when building with GCC

    "g++6"    -o "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe" -Wl,--start-group "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/has_addr2line.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g -m64
    /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.21 required by /wrkdirs/usr/ports/devel/boost-libs/work/boost_1_65_1/bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe not found
    [...]
    Error: Missing: lib/libboost_stacktrace_addr2line.a
    Error: Missing: lib/libboost_stacktrace_addr2line.so
    Error: Missing: lib/libboost_stacktrace_addr2line.so.%%BOOST_SHARED_LIB_VER%%

  PR:		223279
  Submitted by:	jhibbits (based on)

Changes:
  head/devel/boost-libs/Makefile
Comment 11 Justin Hibbits freebsd_committer freebsd_triage 2017-12-10 20:17:20 UTC
Thanks, Jan!
Comment 12 Gerald Pfeifer freebsd_committer freebsd_triage 2017-12-10 22:32:05 UTC
(In reply to Justin Hibbits from comment #8)
> I was operating under the assumption that _-prefixed variables are
> intended to be private to the include file. 

And you're right.  Using ${_GCC_RUNTIME} in individual ports is a
mistake (though introducing another variable that just mirrors that,
if apparently necessary like here, probably is a cure worse than the
disease?)

Could we avoid all of this is bug #200171 was addressed and the
rpath included by the gcc, g++,... drivers?
Comment 13 commit-hook freebsd_committer freebsd_triage 2017-12-11 00:08:19 UTC
A commit references this bug:

Author: jbeich
Date: Mon Dec 11 00:07:17 UTC 2017
New revision: 455916
URL: https://svnweb.freebsd.org/changeset/ports/455916

Log:
  MFH: r455905

  devel/boost-libs: pass RPATH when building with GCC

    "g++6"    -o "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe" -Wl,--start-group "bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/has_addr2line.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g -m64
    /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.21 required by /wrkdirs/usr/ports/devel/boost-libs/work/boost_1_65_1/bin.v2/libs/stacktrace/build/gcc-6.4.0/debug/addr2line_exe not found
    [...]
    Error: Missing: lib/libboost_stacktrace_addr2line.a
    Error: Missing: lib/libboost_stacktrace_addr2line.so
    Error: Missing: lib/libboost_stacktrace_addr2line.so.%%BOOST_SHARED_LIB_VER%%

  PR:		223279
  Submitted by:	jhibbits (based on)
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q4/
  branches/2017Q4/devel/boost-libs/Makefile
Comment 14 Justin Hibbits freebsd_committer freebsd_triage 2017-12-11 02:00:27 UTC
(In reply to Gerald Pfeifer from comment #12)

Forcing the gcc ports to include the rpath themselves would likely solve this problem, yes.  It would also fix other ports, including libreoffice.