Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#61852 closed defect (fixed)

cctools: llvm-objdump: Unknown command line argument '-macho'

Reported by: MStraeten (Martin Straeten) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: bigsur Cc: kencu (Ken), cooljeanius (Eric Gallager)
Port: cctools

Description (last modified by ryandesign (Ryan Carsten Schmidt))

--->  Building json-glib
Error: Failed to build json-glib: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_json-glib/json-glib/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port json-glib failed

failed while rebuilding after purging my old macports installation, my build from 15.11.2020 was successful (big sur, sdk 11.1 + Xcode 12.??)

Attachments (1)

main.log (127.6 KB) - added by MStraeten (Martin Straeten) 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by MStraeten (Martin Straeten)

Attachment: main.log added

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: nefar@… openmaintainer removed
Description: modified (diff)
Keywords: bigsur added
Owner: set to nefar@…
Status: newassigned
Summary: json-glib @1.2.8 build fails with commandline tools for XCode 12.3json-glib @1.2.8: llvm-objdump: Unknown command line argument '-macho'

The error in the log is:

llvm-objdump: Unknown command line argument '-macho'.  Try: '/opt/local/libexec/llvm-11/bin/llvm-objdump --help'
llvm-objdump: Did you mean '-h'?
llvm-objdump: Unknown command line argument '-dylibs-used'.  Try: '/opt/local/libexec/llvm-11/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--dylibs-used'?
llvm-objdump: Unknown command line argument '-non-verbose'.  Try: '/opt/local/libexec/llvm-11/bin/llvm-objdump --help'
llvm-objdump: Did you mean '--non-verbose'?
Traceback (most recent call last):
  File "/opt/local/bin/g-ir-scanner", line 99, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/opt/local/lib/gobject-introspection/giscanner/scannermain.py", line 579, in scanner_main
    shlibs = create_binary(transformer, options, args)
  File "/opt/local/lib/gobject-introspection/giscanner/scannermain.py", line 419, in create_binary
    shlibs = resolve_shlibs(options, binary, options.libraries)
  File "/opt/local/lib/gobject-introspection/giscanner/shlibs.py", line 183, in resolve_shlibs
    _resolve_non_libtool(options, binary, non_libtool))
  File "/opt/local/lib/gobject-introspection/giscanner/shlibs.py", line 103, in _resolve_non_libtool
    output = subprocess.check_output(args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/bin/sh', '../libtool', '--mode=execute', 'otool', '-L', '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_json-glib/json-glib/work/json-glib-1.2.8/json-glib/tmp-introspectnoqc3uiz/Json-1.0']' returned non-zero exit status 1.

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

It sounds like otool -L is invoking llvm-objdump with the -macho, -dylibs-used, and -non-verbose flags, but that the version of llvm-objdump in the llvm-11 port does not support those flags. From https://reviews.llvm.org/D92310 it sounds like the flags might now need two leading dashes rather than one. Try deactivating the llvm-11 port.

comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Or try reinstalling the cctools port with the +xcode variant, in case it is not already installed with that variant.

comment:4 Changed 4 years ago by MStraeten (Martin Straeten)

yep, by default cctools was activated with +llvm11. reinstalling it with +xcode does the job ;)

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

cctools should only ever be installed with the +xcode variant on newer systems, much like ld64 should only ever be installed with the xcode variant on newer systems (but they are different -- no "helpful" portgroup to cover both please).

We had that set up, but Jeremy deleted it last year. I am not sure why.

The cctools port will never be as up-to-date as the xcode-supplied cctools, due to the timing of the open source drops and other factors (ie me).

So I will change it back to an xcode variant default on all newer systems. People that already have it installed as an llvm variant will need to reinstall it as an xcode variant. Chris put something in the cctools port last year to force that to happen, and we may well need to do that again, although it will frustrate users who actually want an llvm variant (which is probably why Jeremy dumped it out of the Portfile last year).

comment:6 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: kencu added
Owner: changed from nefar@… to jeremyhu
Port: cctools added; json-glib removed
Summary: json-glib @1.2.8: llvm-objdump: Unknown command line argument '-macho'cctools: llvm-objdump: Unknown command line argument '-macho'

Has duplicate #61853.

comment:7 Changed 4 years ago by ken-cunningham-webuse

Resolution: fixed
Status: assignedclosed

In 5cbe41b22fb3e738be3aa0f2eddb9bea0248a7ca/macports-ports (master):

cctools: tweak defaults

cctools in xcode is newer than the cctools port
for all systems that use Xcode 11 or newer,
so default to +xcode on those systems

the llvm-11 version of llvm-objdump changed the
arguments it accepts, causing many builds to break
use llvm-10 by default instead of llvm-11 until
such time as xcode also shares that new default

users who want to find bugs and fix them can manually use
the llvm11 variant of cctools to find and discover these
bugs if they choose to do so

closes: #61852

comment:8 Changed 2 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.