Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcltk-8.6.10-2: nm: invalid option -- j #1063

Open
cooljeanius opened this issue Sep 26, 2023 · 7 comments
Open

tcltk-8.6.10-2: nm: invalid option -- j #1063

cooljeanius opened this issue Sep 26, 2023 · 7 comments

Comments

@cooljeanius
Copy link

Looks like tcltk's build system is trying to pass a flag to nm that it doesn't recognize:

gcc -dynamiclib -Os -pipe   -L/opt/sw/lib/0 -L/opt/sw/lib -Wl,-headerpad_max_install_names -headerpad_max_install_names -Wl,-search_paths_first  -Wl,-single_module -o libtk8.6.dylib tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkBusy.o tkClipboard.o tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o tkButton.o tkEntry.o tkFrame.o tkListbox.o tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkPanedWindow.o tkScale.o tkScrollbar.o tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o tkImage.o tkImgBmap.o tkImgGIF.o tkImgPNG.o tkImgPPM.o tkImgPhoto.o tkImgPhInstance.o tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o tkTextMark.o tkTextTag.o tkTextWind.o tkStubInit.o ttkBlink.o ttkButton.o ttkCache.o ttkClamTheme.o ttkClassicTheme.o ttkDefaultTheme.o ttkElements.o ttkEntry.o ttkFrame.o ttkImage.o ttkInit.o ttkLabel.o ttkLayout.o ttkManager.o ttkNotebook.o ttkPanedwindow.o ttkProgress.o ttkScale.o ttkScrollbar.o ttkScroll.o ttkSeparator.o ttkSquare.o ttkState.o ttkTagSet.o ttkTheme.o ttkTrace.o ttkTrack.o ttkTreeview.o ttkWidget.o ttkStubInit.o tkUnix.o tkUnix3d.o tkUnixButton.o tkUnixColor.o tkUnixConfig.o tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o tkUnixFocus.o  tkUnixRFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o tkUnixSend.o tkUnixWm.o tkUnixXId.o  -lpthread -L/opt/sw/lib -lXft -lfontconfig -lfreetype -lfontconfig -L/usr/X11/lib -lX11 -Wl,-weak-lXss -lXext  -lz  -lpthread  /opt/sw/src/fink.build/tcltk-8.6.10-2/tcl8.6.10/unix/libtclstub8.6.a  -compatibility_version 8.6 -current_version 8.6.10 -install_name "/opt/sw/lib/libtk8.6.dylib" -unexported_symbols_list $(f=libtk8.6.dylib.E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[0-9a-f]+ . \.objc/ {print \$3}" > $f && nm -gjp "/opt/sw/src/fink.build/tcltk-8.6.10-2/tcl8.6.10/unix"/libtclstub8.6.a | grep ^_[^_] >> $f && echo $f) -sectcreate __TEXT __info_plist Tk-Info.plist 
nm: invalid option -- j
Usage: nm [option(s)] [file(s)]
 List symbols in [file(s)] (a.out by default).
 The options are:
  -a, --debug-syms       Display debugger-only symbols
  -A, --print-file-name  Print name of the input file before every symbol
  -B                     Same as --format=bsd
  -C, --demangle[=STYLE] Decode low-level symbol names into user-level names
                          The STYLE, if specified, can be `auto' (the default),
                          `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'
                          or `gnat'
      --no-demangle      Do not demangle low-level symbol names
      --recurse-limit    Enable a demangling recursion limit.  This is the default.
      --no-recurse-limit Disable a demangling recursion limit.
  -D, --dynamic          Display dynamic symbols instead of normal symbols
      --defined-only     Display only defined symbols
  -e                     (ignored)
  -f, --format=FORMAT    Use the output format FORMAT.  FORMAT can be `bsd',
                           `sysv' or `posix'.  The default is `bsd'
  -g, --extern-only      Display only external symbols
  -l, --line-numbers     Use debugging information to find a filename and
                           line number for each symbol
  -n, --numeric-sort     Sort symbols numerically by address
  -o                     Same as -A
  -p, --no-sort          Do not sort the symbols
  -P, --portability      Same as --format=posix
  -r, --reverse-sort     Reverse the sense of the sort
      --plugin NAME      Load the specified plugin
  -S, --print-size       Print size of defined symbols
  -s, --print-armap      Include index for symbols from archive members
      --size-sort        Sort symbols by size
      --special-syms     Include special symbols in the output
      --synthetic        Display synthetic symbols as well
  -t, --radix=RADIX      Use RADIX for printing symbol values
      --target=BFDNAME   Specify the target object format as BFDNAME
  -u, --undefined-only   Display only undefined symbols
      --with-symbol-versions  Display version strings after symbol names
  -X 32_64               (ignored)
  @FILE                  Read options from FILE
  -h, --help             Display this information
  -V, --version          Display this program's version number

nm: supported targets: mach-o-x86-64 mach-o-i386 mach-o-le mach-o-be mach-o-fat pef pef-xlib sym srec symbolsrec verilog tekhex binary ihex plugin
clang: error: no such file or directory: '__TEXT'
clang: error: no such file or directory: '__info_plist'
make: *** [Makefile:591: libtk8.6.dylib] Error 1
make: Leaving directory '/opt/sw/src/fink.build/tcltk-8.6.10-2/tk8.6.10/unix'
### execution of /tmp/fink.g0NoF failed, exit code 2
### execution of /tmp/fink.jXJJU failed, exit code 2
Removing runtime build-lock...
Removing build-lock package...
/opt/sw/bin/dpkg-lockwait -r fink-buildlock-tcltk-8.6.10-2
(Reading database ... 
dpkg: serious warning: files list file for package `fink-buildlock-ccp4-6.5-1' missing, assuming package has no files currently installed.
994865 files and directories currently installed.)
Removing fink-buildlock-tcltk-8.6.10-2 ...

I'm on Big Sur with Xcode 13.
cc @dmacks

@nieder
Copy link
Member

nieder commented Sep 26, 2023

What's the output of which nm; type -a nm ?

@sth0
Copy link
Contributor

sth0 commented Sep 26, 2023 via email

@cooljeanius
Copy link
Author

What's the output of which nm; type -a nm ?

$ which nm; type -a nm
/usr/bin/nm
nm is /usr/bin/nm
nm is /opt/local/bin/nm
nm is /usr/bin/nm
nm is /opt/sw/bin/nm
nm is /opt/local/bin/nm
nm is /opt/iains/x86_64-apple-darwin10/darwin-gcc-5-3r0/bin/nm
nm is /opt/iains/x86_64-apple-darwin19/gcc-7-5-toolchain/bin/nm
$ nm --version
Apple LLVM version 13.0.0 (clang-1300.0.29.30)
  Optimized build.
  Default target: x86_64-apple-darwin20.6.0
  Host CPU: skylake

@dmacks
Copy link
Member

dmacks commented Sep 27, 2023

My 10.13's /usr/bin/nm (Apple LLVM version 10.0.0 (clang-1000.11.45.5)) accepts both -j and -just-symbol-name. Even the latest upstream release and development versions of tk have nm -gjp for some important-looking darwin-specific library handling. So "some" versions of LLVM's nm have it. It looks like it's also in binutils as of 2.37, but fink's package is 2.36 and doesn't include the nm tool at all.

@cooljeanius
Copy link
Author

The workaround for #1061 (deactivating x86-64-binutils-default) seems to have worked for me here, too

@dmacks
Copy link
Member

dmacks commented Sep 28, 2023

Good find! I just pushed a new version of objtools, which could be a template for updating *-binutils to a version that accepts -j.

@cooljeanius
Copy link
Author

Good find! I just pushed a new version of objtools, which could be a template for updating *-binutils to a version that accepts -j.

Confirming that the new objtools built successfully, and that tcltk is now up-to-date for me (although the underlying issue here should probably still be fixed, though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants