Page MenuHomeFreeBSD

Disconnect objdump from the build

Authored by emaste on Jul 27 2016, 6:45 PM.



The in-tree binutils is old and will not be updated. Other tools are migrating to copyfree alternatives but there is not yet a direct replacement for objdump. Just remove it as it is not used by the build, and updated and maintained versions are available from ports and packages.

Note: Will not be committed prior to 11.0 being released.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

emaste updated this revision to Diff 18821.Jul 27 2016, 6:45 PM
emaste retitled this revision from to Disconnect objdump from the build.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added subscribers: brooks, bdrewery, imp, jhb. to be updated as well prior to commit. Not done yet as conflicts would be encountered on each rebase.

Note that llvm-objdump is starting to gain features currently missing compared to GNU objdump -- most importantly, -S (mixed source and disassembly) was recently added.

emaste added a comment.Sep 9 2016, 3:06 PM

Note there is a consumer in ports Mk/bsd/

security-check: ${TMPPLIST}
# Scan PLIST for:
#   2.  accept()/recvfrom() which indicates network listening capability
#   3.  insecure functions (gets/mktemp/tempnam/[XXX])
#   4.  startup scripts, in conjunction with 2.                                 
    | ${XARGS} -0 -n 1 ${OBJDUMP} -R 2> /dev/null > ${WRKDIR}/.PLIST.objdump; \ 

We can use readelf -r as a replacement for objdump -R, although readelf -Ws | sed -En 's/^.* UND ([^@]+).*$/\1/p' might be more suitable.

There are also instances of ${OBJDUMP} in the Makefiles for graphics/OpenEXR (see D7842), devel/aros-sdk, devel/abi-compliance-checker, dns/dnsmasq, dns/dnsmasq-devel. The two dnsmask uses can be addressed with a change equivalent to D7842; the other two ports need more investigation.

D7881 for dns/dnsmasq and dns/dnsmasq-devel

emaste updated this revision to Diff 20986.Oct 3 2016, 6:10 PM

Rebase after rS306649, add to

I really like this tool but you're right, we can just use the package.

It will break the ports security-check thing which runs at 'make install' time. See OBJDUMP usage in /usr/ports/Mk/ in security-check target and uses Mk/Scripts/security-check.awk for parsing. It looks like it is pretty trivial to convert to readelf format.

jhb added a comment.Jan 12 2018, 5:17 PM

Is llvm-objdump far enough along to implement the functionality needed by ports?

For the ports infrastructure security-check thing we should just switch to readelf instead.

A ports exp-run w/o objdump is in PR 212319. Failures were a bunch of gcc packages:

  • devel/aarch64-none-elf-gcc
  • devel/amd64-gcc
  • devel/arm-none-eabi-gcc
  • devel/arm-none-eabi-gcc492
  • devel/avr-gcc
  • devel/avr-gcc-devel
  • devel/gcc-arm-embedded
  • devel/gcc-msp430-ti-toolchain
  • devel/mingw32-gcc
  • devel/mips-gcc
  • devel/mips64-gcc
  • devel/powerpc64-gcc
  • devel/psptoolchain-gcc-stage1
  • devel/sparc64-gcc

and x11-fm/gnome-commander2

Also graphics/OpenEXR and lang/fsharp on i386.

emaste updated this revision to Diff 50228.Nov 9 2018, 7:45 PM

Rebase and add WITH_BINUTILS and WITHOUT_BINUTILS updates

emaste abandoned this revision.Nov 23 2018, 7:41 PM

Plan to migrate to llvm-objdump instead, in D18307

emaste reclaimed this revision.Nov 30 2018, 2:11 PM
emaste added a subscriber: kib.

In D18307 @kib suggests not installing as objdump; leave both reviews open until we decide.

swills added a subscriber: swills.Aug 31 2019, 1:56 AM
This revision was not accepted when it landed; it landed in state Needs Review.May 6 2020, 6:38 PM
This revision was automatically updated to reflect the committed changes.