[MacPorts] #57612: clang does not respect -syslibroot when linking

MacPorts noreply at macports.org
Mon Dec 17 03:12:35 UTC 2018


#57612: clang does not respect -syslibroot when linking
---------------------+--------------------
  Reporter:  kencu   |      Owner:  (none)
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:
Resolution:          |   Keywords:
      Port:          |
---------------------+--------------------

Comment (by kencu):

 Replying to [comment:26 jeremyhu]:
 > With Mojave +, we use the SDK directly.

 This will force us to get it right, finally. Using an SDK has often not
 really worked as expected up until now, and now we know why not.


 >  If you intend to set the SDKROOT when invoking clang, you should do
 that with `-isysroot` instead of `-Wl,-syslibroot.  The latter only passes
 that information to the linker whereas the former informs all stages of
 the build pipeline.

 And importantly, it passes the path to linker in such a way as it is
 nonfunctional, because it is overridden by clang anyway with an -isysroot
 (either the one you indicated, or one spec'd by xcrun). Either way, your
 syslibroot is not going to do anything useful (99% of the time, when cfe
 drives the linker).

-- 
Ticket URL: <https://trac.macports.org/ticket/57612#comment:27>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list