Bug 212308 - graphics/OpenEXR fails when objdump is missing
Summary: graphics/OpenEXR fails when objdump is missing
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Some People
Assignee: Matthias Andree
URL:
Keywords:
Depends on:
Blocks: 201763
  Show dependency treegraph
 
Reported: 2016-09-01 14:40 UTC by Andrew Turner
Modified: 2016-09-10 17:53 UTC (History)
1 user (show)

See Also:
mandree: maintainer-feedback+


Attachments
Build log (8.96 KB, text/plain)
2016-09-01 14:40 UTC, Andrew Turner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Turner freebsd_committer freebsd_triage 2016-09-01 14:40:56 UTC
Created attachment 174288 [details]
Build log

OpenEXR assumes objdump exists, however on arm64 this is not the case. It seems to need it for detecting the C++ standard library:

===>  Configuring for OpenEXR-2.2.0_5
/bin/sh: objdump: not found
*** Your ilmbase package uses a different C++ standard library than ***
*** OpenEXR would. Please recompile and reinstall ilmbase with the  ***
*** same C++ std. library before trying to build OpenEXR.  Abort.   ***
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/OpenEXR
Comment 1 Matthias Andree freebsd_committer freebsd_triage 2016-09-01 16:38:50 UTC
Yeah, so how would that missing objdump be an OpenEXR bug? Fix the missing objdump on arm64 instead.
Comment 2 Ed Maste freebsd_committer freebsd_triage 2016-09-01 17:08:17 UTC
It's likely that objdump will disappear from the base system across all architectures in the near future, so ports that require it are going to need to depend on binutils as a build-dependency.
Comment 3 Ed Maste freebsd_committer freebsd_triage 2016-09-01 17:16:25 UTC
FWIW objdump is used like so in the port's configure test:

  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then

for this test objdump -p could be replaced with readelf -d
Comment 4 Matthias Andree freebsd_committer freebsd_triage 2016-09-01 18:20:50 UTC
Ed, objdump isn't going away from the FreeBSD 9...11 base systems for compatibility reasons.

Feel free to reopen the bug when FreeBSD 12 reaches the next-to-last BETA before the RC phase and objdump is really gone on the Tier-1 architectures as well, then I'll consider adding a build requisite, but not sooner. 

Until that day, this shall be a non-issue for me.  I will not waste time chasing moving and incomplete targets on odd or new architectures that need to stabilize.

If there is a really good reason, I may consider patches, but at this time, I expect ARM64 to provide a compatible build environment where all the default bintools are available.  If ARM64 needs objdump from a port, then the ports framework shall handle that, not each and every port.
Comment 5 Ed Maste freebsd_committer freebsd_triage 2016-09-01 18:32:03 UTC
> Ed, objdump isn't going away from the FreeBSD 9...11 base systems for
> compatibility reasons.

Indeed, and that's why I didn't reopen the bug. I'm merely providing background info here. I intend to request an exp-run without /usr/bin/objdump to see how widespread is the fallout, and that will help determine what our path forward should be.
Comment 6 Matthias Andree freebsd_committer freebsd_triage 2016-09-01 18:35:23 UTC
Thanks.
Comment 7 Matthias Andree freebsd_committer freebsd_triage 2016-09-01 18:36:25 UTC
BTW, Re: comment #3, who is telling me that readelf isn't going away from the base system at the same time as objdump is? :-)
Comment 8 Ed Maste freebsd_committer freebsd_triage 2016-09-01 18:38:27 UTC
> who is telling me that readelf isn't going away from the base system at the same 
> time as objdump is?

I am :-)  In HEAD and FreeBSD 11 readelf comes from ELF Tool Chain not binutils.
Comment 9 Andrew Turner freebsd_committer freebsd_triage 2016-09-01 23:00:15 UTC
I think all you would need to do is add a build dependency on devel/binutils. It could be just done for arm64 using something like the following:

.if ${ARCH} == "aarch64"
<Add build dep here>
.endif

I can test build patches in a poudriere instance on arm64 hardware.
Comment 10 Matthias Andree freebsd_committer freebsd_triage 2016-09-02 00:45:55 UTC
Andrew, please add this to some central place, not to individual ports.  If aarch64 is the odd one out not installing objdump in the base system, more ports than just this one needs the workaround, dependency information and all that.  See Comment #4.
Comment 11 Andrew Turner freebsd_committer freebsd_triage 2016-09-02 09:09:54 UTC
I have yet to find any other ports that need objdump to build. We are currently building 19k-20k ports on arm64 so it is possible some of the remaining ports will need it, however OpenEXR is blocking more than any other failed port, around 500 in the current quarterly package build.
Comment 12 Ed Maste freebsd_committer freebsd_triage 2016-09-02 17:42:46 UTC
> I have yet to find any other ports that need objdump to build.

I did find two others while looking at the failures: mail/thunderbird and www/libxul, but either way it's a really small number.

Perhaps we need to add a USES=objdump to ports, which will depend on the binutils port for arm64 on FreeBSD11 (and soon on all architectures on -CURRENT), and use /usr/bin/objdump otherwise.

In most cases where a port's own Makefile uses objdump (as opposed to e.g. configure within the port) we probably ought to use readelf instead.
Comment 13 Ed Maste freebsd_committer freebsd_triage 2016-09-09 15:25:46 UTC
Patch in review to switch objdump to readelf in the C++ library check: https://reviews.freebsd.org/D7842
Comment 14 commit-hook freebsd_committer freebsd_triage 2016-09-09 18:51:23 UTC
A commit references this bug:

Author: mandree
Date: Fri Sep  9 18:50:34 UTC 2016
New revision: 421626
URL: https://svnweb.freebsd.org/changeset/ports/421626

Log:
  Replace objdump by readelf. Fixes build on arm64.

  While here, refresh patches.

  PR:		212308
  Submitted by:	emaste@
  Reported by:	andrew@
  MFH:		2016Q3
  Differential Revision:	D7842

Changes:
  head/graphics/OpenEXR/Makefile
  head/graphics/OpenEXR/files/patch-IlmImfUtil__Makefile.in
  head/graphics/OpenEXR/files/patch-IlmImf_ImfFastHuf.cpp
  head/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp
  head/graphics/OpenEXR/files/patch-IlmImf__Makefile.in
  head/graphics/OpenEXR/files/patch-exrenvmap__main.cpp
  head/graphics/OpenEXR/files/patch-exrmaketiled__main.cpp
Comment 15 commit-hook freebsd_committer freebsd_triage 2016-09-10 14:22:58 UTC
A commit references this bug:

Author: mandree
Date: Sat Sep 10 14:22:41 UTC 2016
New revision: 421694
URL: https://svnweb.freebsd.org/changeset/ports/421694

Log:
  Fixup r421626 to unbreak build on newer readelf.

  PR:		212308
  Reported by:	antoine@
  Differential Revision:	D7842

Changes:
  head/graphics/OpenEXR/Makefile
Comment 16 commit-hook freebsd_committer freebsd_triage 2016-09-10 17:53:17 UTC
A commit references this bug:

Author: mandree
Date: Sat Sep 10 17:52:31 UTC 2016
New revision: 421712
URL: https://svnweb.freebsd.org/changeset/ports/421712

Log:
  MFH: r421626 r421694

  Replace objdump by readelf. Fixes build on arm64.

  While here, refresh patches.

  PR:		212308
  Submitted by:	emaste@
  Reported by:	andrew@
  Differential Revision:	D7842

  Fixup r421626 to unbreak build on newer readelf.

  Reported by:	antoine@

  Approved by:	portmgr (feld@)

Changes:
_U  branches/2016Q3/
  branches/2016Q3/graphics/OpenEXR/Makefile
  branches/2016Q3/graphics/OpenEXR/files/patch-IlmImfUtil__Makefile.in
  branches/2016Q3/graphics/OpenEXR/files/patch-IlmImf_ImfFastHuf.cpp
  branches/2016Q3/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp
  branches/2016Q3/graphics/OpenEXR/files/patch-IlmImf__Makefile.in
  branches/2016Q3/graphics/OpenEXR/files/patch-exrenvmap__main.cpp
  branches/2016Q3/graphics/OpenEXR/files/patch-exrmaketiled__main.cpp