[vlc-devel] [PATCH 1/2] configure: allow toggling of -Wl, -z, defs and -no-undefined

Marvin Scholz epirat07 at gmail.com
Mon Jun 19 14:31:38 CEST 2017

On 15 Mar 2017, at 19:31, Marvin Scholz wrote:

> On 15 Mar 2017, at 15:46, Rémi Denis-Courmont wrote:
>> On March 15, 2017 4:42:34 PM GMT+02:00, "Filip Roséen" 
>> <filip at atch.se> wrote:
>>> Hi Rémi,
>>> On 2017-03-15 16:28, Rémi Denis-Courmont wrote:
>>>> On mercredi 15 mars 2017 15:24:06 EET Filip Roséen wrote:
>>>>> A developer should know his/her platform well enough to be able to
>>>>> manually specify the sanitizer flags, which
>>> `--disable-no-undefined`
>>>>> allows.
>>>> A developer should know his/her platform well enough to handle
>>> sanitizers with
>>>> the --no-undefined option.
>>> So you are saying that those who wants to use the sanitizer with a
>>> shall manually patch `configure.ac` and the relevant `Makefile.am` 
>>> in
>>> order to remove the usage of `-Wl,-z,defs` and `-no-undefined` in
>>> order to achieve satisfying sanitizer usage?
>>> Or specify complicated flags just to circumvent the fact that we now
>>> unconditionally add flags on platform where they apply, but silently
>>> ignore them on platforms that says they do not.
>>> If we want to have developers to really fight in order
>>> to use a sanitizer, or prevent `-Wl,-z,defs` and `-no-undefined` 
>>> from
>>> being able to easily test functions from out-of-tree objects (which
>>> greatly simplies things such as benchmarks of individual functions, 
>>> at
>>> least in my opinion), I guess one also **could** replace the linker
>>> with a wrapper that pretends that it does not understand the 
>>> relevant
>>> flags, and have a "clean" build without `-Wl,-z,defs`.
>>>> I agree that an option for sanitizers is not very useful insofar as
>>> it will be
>>>> disabled by default. Afterall, those who know about it, would also
>>> know how to
>>>> do it manually. Well then there are no needs to change anything at
>>> all. Easy.
>>> I did not say that the option for sanitizer would not be very 
>>> useful.
>>> My fear is that it will be more complex to implement than to allow
>>> developers to specify `--disable-no-undefined` and setting the
>>> *simple* flags themselves.
>>> Also, as mentioned, if `--enable-sanitizer=...` is allowed to 
>>> disable
>>> the usage of `-Wl,-z,defs` and `-no-undefined` I cannot understand 
>>> why
>>> such would be allowed, but not this patch.
>>> Best Regards,\
>>> Filip
>> To be clear, I have no problems using all 3 sanitizers with both GCC 
>> and clang and without patching the build system. So I am unable to 
>> answer your question.
> I am not sure about other operating systems, but at least on macOS I 
> am not aware of an easy way of using the address
> sanitizer without the flag introduced by this patch.

This patch is still relevant, could I please get a reply? If there is 
another way to build with asan on macOS, please let me know.

The asan documentation states:

> When linking shared libraries, the AddressSanitizer run-time is not 
> linked, so -Wl,-z,defs may cause link errors (don’t use it with 
> AddressSanitizer)

and I currently know of no way to do this, without these patches.

Marvin Scholz

More information about the vlc-devel mailing list