Linker warning on macos

Issue #616 resolved
Scott Baden created an issue

A couple of weeks ago I started getting an innocuous message
each time I build a upc++ app under MacOS including

ld: warning: -multiply_defined is obsolete

See for example, the laplac2d upcxx-extras app

The apps work as expected, so the message appears harmless

Software Environment
Ventura Version: 13.0.1
Xcode Version: 14.3
Apple clang version 15.0.0

Comments (12)

  1. Paul Hargrove

    Thanks for the report, Scott.

    I suspect that we simply need add configure logic in GASNet-EX to make addition of -Wl,-multiply_defined,suppress to LDFLAGS conditional (omitting it if a warning is generated).

    However, I believe that your toolchain is newer than we have access to for testing. So, we may need to ask for your assistance in testing the fix.

    -Paul

  2. Paul Hargrove

    Fwiw, the problematic -multiply_defined <treatment> linker option has been documented as "obsolete" since the ld manpage for macOS 10.5 (released Oct 2007), but was supported in 10.4 (released Apr 2005). It is only now that the linker is warning about this option.

  3. Paul Hargrove

    @Scott Baden (and possibly @Amir Kamil),

    Please try configuring UPC++ using --with-gasnet=https://bitbucket.org/PHHargrove/gasnet-public/get/upcxx-issue-616.tar.gz. That will download and use a GASNet-EX patched to hopefully address this issue.

    -Paul

  4. Amir Kamil

    That eliminates the warning for me when using Clang.

    For GCC via Homebrew, I have to set CXXFLAGS to -Wl,-ld_classic. This isn’t UPC++-specific, and I suspect the fix needs to be on Homebrew’s front rather than ours.

  5. Paul Hargrove

    @Amir Kamil , thanks for the confirmation of the fix. I agree that if the need for -Wl,-ld_classic with Homebrew's gcc is not specific to UPC++ then it is not something we should be trying to automate or even document.

  6. Paul Hargrove

    @Scott Baden , since there are many ways your environment and/or toolchain might differ from Amir's, I am still hoping you can find time to confirm that configuring using --with-gasnet=https://bitbucket.org/PHHargrove/gasnet-public/get/upcxx-issue-616.tar.gz is sufficient to resolve the problem for you.

  7. Log in to comment