Properly "disabling" -syslibroot flag from Portfile

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Properly "disabling" -syslibroot flag from Portfile

Mojca Miklavec-2
Hi,

I did not dare to switch to 10.14 yet (so I cannot really test), but
it seems that a user of Mojave had troubles compiling MinGW-w64 due to
the -syslibroot flag being automatically added to compiler flags, see:

     https://trac.macports.org/ticket/57448

What's the proper way to disable this behaviour from the Portfile?
(Also, if any developer on 10.14 was willing to try this out ...)

Thank you very much,
    Mojca
Reply | Threaded
Open this post in threaded view
|

Re: Properly "disabling" -syslibroot flag from Portfile

Joshua Root-8
On 2018-10-27 07:10 , Mojca Miklavec wrote:

> Hi,
>
> I did not dare to switch to 10.14 yet (so I cannot really test), but
> it seems that a user of Mojave had troubles compiling MinGW-w64 due to
> the -syslibroot flag being automatically added to compiler flags, see:
>
>      https://trac.macports.org/ticket/57448
>
> What's the proper way to disable this behaviour from the Portfile?
> (Also, if any developer on 10.14 was willing to try this out ...)

This is added based on a non-empty configure.sdkroot being used. It
doesn't actually add -syslibroot to the compiler flags, but
'-isysroot${configure.sdkroot}' to the compiler flags and
'-Wl,-syslibroot,${configure.sdkroot}' to LDFLAGS.

Clearing configure.sdkroot will of course prevent all this, but it's
usually a bad idea since there is no /usr/include on Mojave. But
cross-compilers are an exception in many ways.

- Josh