Re: CVS commit: src/external/cddl/osnet/lib/libdtrace

2018-06-06 Thread Joerg Sonnenberger
On Wed, Jun 06, 2018 at 02:18:39PM +, Kamil Rytarowski wrote:
> Module Name:  src
> Committed By: kamil
> Date: Wed Jun  6 14:18:39 UTC 2018
> 
> Modified Files:
>   src/external/cddl/osnet/lib/libdtrace: Makefile
> 
> Log Message:
> Make cddl/osnet/lib/libdtrace buildable with MKLLVM=yes

This is not the correct way to fix this. First of all, the flags are
conditional even for GCC, but more importantly, HAVE_GCC does not mean
that the compiler is GCC. See i.e. ah_regdomain.c handling in sys/conf.

Joerg


Re: CVS commit: src

2018-06-06 Thread Christos Zoulas
On Jun 6,  9:47am, n...@gmx.com (Kamil Rytarowski) wrote:
-- Subject: Re: CVS commit: src

| CC: + Yang Zheng who investigated the root cause.

http://mail-index.netbsd.org/source-changes/2018/06/02/msg095659.html

Conditionally elide it.

christos


Re: CVS commit: src

2018-06-06 Thread Kamil Rytarowski
On 06.06.2018 13:43, Christos Zoulas wrote:
> On Jun 6,  9:47am, n...@gmx.com (Kamil Rytarowski) wrote:
> -- Subject: Re: CVS commit: src
> 
> | CC: + Yang Zheng who investigated the root cause.
> 
> http://mail-index.netbsd.org/source-changes/2018/06/02/msg095659.html
> 
> Conditionally elide it.
> 
> christos
> 

I see, I will commit it to src/ now!



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src

2018-06-06 Thread Christos Zoulas
On Jun 6,  9:47am, n...@gmx.com (Kamil Rytarowski) wrote:
-- Subject: Re: CVS commit: src

| >=20
| > Log Message:
| > - Change LDADD/DPADD in library dependencies to LIBDPLIBS
| > - Fix some LDADD abuse and remove useless dependencies
| > - include  in the right place where appropriate
| > From Rin Okuyama
| >=20
| 
| In this commit:

The solution I chose for that was to ifdef the -z,defs with MKSANITIZER.

christos


Re: CVS commit: src

2018-06-06 Thread Kamil Rytarowski
CC: + Yang Zheng who investigated the root cause.

On 06.06.2018 09:47, Kamil Rytarowski wrote:
> On 05.01.2016 14:07, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Tue Jan  5 13:07:47 UTC 2016
>>
>> Modified Files:
>>  src/external/bsd/blacklist/lib: Makefile
>>  src/external/bsd/elftoolchain/lib/libdwarf: Makefile
>>  src/external/bsd/fetch/lib: Makefile
>>  src/external/bsd/libc++/lib: Makefile
>>  src/external/gpl2/lvm2/lib/liblvm: Makefile
>>  src/external/gpl3/gcc.old/lib/libtsan: Makefile
>>  src/external/gpl3/gcc/lib/libtsan: Makefile
>>  src/external/mit/xorg/lib/libfontenc: Makefile
>>  src/external/mit/xorg/lib/libglut: Makefile
>>  src/external/mit/xorg/lib/libpciaccess: Makefile
>>  src/external/public-domain/xz/lib: Makefile
>>  src/lib/libnpf: Makefile
>>  src/sys/rump/kern/lib/libsljit: Makefile
>>
>> Log Message:
>> - Change LDADD/DPADD in library dependencies to LIBDPLIBS
>> - Fix some LDADD abuse and remove useless dependencies
>> - include  in the right place where appropriate
>> From Rin Okuyama
>>
> 
> In this commit:
> 
>> Index: src/external/bsd/libc++/lib/Makefile
>> diff -u src/external/bsd/libc++/lib/Makefile:1.7 
>> src/external/bsd/libc++/lib/Makefile:1.8
>> --- src/external/bsd/libc++/lib/Makefile:1.7 Wed Aug 20 11:19:39 2014
>> +++ src/external/bsd/libc++/lib/Makefile Tue Jan  5 08:07:46 2016
>> @@ -1,4 +1,4 @@
>> -#   $NetBSD: Makefile,v 1.7 2014/08/20 15:19:39 joerg Exp $
>> +#   $NetBSD: Makefile,v 1.8 2016/01/05 13:07:46 christos Exp $
>>  
>>  LIB=c++
>>  WARNS=  4
>> @@ -44,6 +44,6 @@ CWARNFLAGS.clang+= -Wno-error=missing-pr
>>  CWARNFLAGS.clang+=  -Wno-error=missing-field-initializers -Wno-error=switch
>>  CWARNFLAGS.clang+=  -Wno-error=implicit-exception-spec-mismatch
>>  
>> -LDADD+= -Wl,-z,defs
>> +LDFLAGS+=   -Wl,-z,defs
>>  
>>  .include 
>>
> 
> I know that this -z defs was added by Joerg earlier, but what's the
> purpose of it? Do we really need it? Can we drop it?
> 
> It breaks building libc++ with sanitizers. This flag is explicitly
> adviced against being used at least for ASan and MSan (and certainly
> others):
> 
> 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).
> 
> https://clang.llvm.org/docs/AddressSanitizer.html
> 
> When linking shared libraries, the MemorySanitizer run-time is not
> linked, so -Wl,-z,defs may cause link errors (don’t use it with
> MemorySanitizer).
> 
> https://clang.llvm.org/docs/MemorySanitizer.html
> 
> 
> Removal of this -Wl,-z,defs, allows us to build libcxx under MSan.
> 




signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src

2018-06-06 Thread Kamil Rytarowski
On 05.01.2016 14:07, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Tue Jan  5 13:07:47 UTC 2016
> 
> Modified Files:
>   src/external/bsd/blacklist/lib: Makefile
>   src/external/bsd/elftoolchain/lib/libdwarf: Makefile
>   src/external/bsd/fetch/lib: Makefile
>   src/external/bsd/libc++/lib: Makefile
>   src/external/gpl2/lvm2/lib/liblvm: Makefile
>   src/external/gpl3/gcc.old/lib/libtsan: Makefile
>   src/external/gpl3/gcc/lib/libtsan: Makefile
>   src/external/mit/xorg/lib/libfontenc: Makefile
>   src/external/mit/xorg/lib/libglut: Makefile
>   src/external/mit/xorg/lib/libpciaccess: Makefile
>   src/external/public-domain/xz/lib: Makefile
>   src/lib/libnpf: Makefile
>   src/sys/rump/kern/lib/libsljit: Makefile
> 
> Log Message:
> - Change LDADD/DPADD in library dependencies to LIBDPLIBS
> - Fix some LDADD abuse and remove useless dependencies
> - include  in the right place where appropriate
> From Rin Okuyama
> 

In this commit:

> Index: src/external/bsd/libc++/lib/Makefile
> diff -u src/external/bsd/libc++/lib/Makefile:1.7 
> src/external/bsd/libc++/lib/Makefile:1.8
> --- src/external/bsd/libc++/lib/Makefile:1.7  Wed Aug 20 11:19:39 2014
> +++ src/external/bsd/libc++/lib/Makefile  Tue Jan  5 08:07:46 2016
> @@ -1,4 +1,4 @@
> -#$NetBSD: Makefile,v 1.7 2014/08/20 15:19:39 joerg Exp $
> +#$NetBSD: Makefile,v 1.8 2016/01/05 13:07:46 christos Exp $
>  
>  LIB= c++
>  WARNS=   4
> @@ -44,6 +44,6 @@ CWARNFLAGS.clang+=  -Wno-error=missing-pr
>  CWARNFLAGS.clang+=   -Wno-error=missing-field-initializers -Wno-error=switch
>  CWARNFLAGS.clang+=   -Wno-error=implicit-exception-spec-mismatch
>  
> -LDADD+=  -Wl,-z,defs
> +LDFLAGS+=-Wl,-z,defs
>  
>  .include 
> 

I know that this -z defs was added by Joerg earlier, but what's the
purpose of it? Do we really need it? Can we drop it?

It breaks building libc++ with sanitizers. This flag is explicitly
adviced against being used at least for ASan and MSan (and certainly
others):

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).

https://clang.llvm.org/docs/AddressSanitizer.html

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

https://clang.llvm.org/docs/MemorySanitizer.html


Removal of this -Wl,-z,defs, allows us to build libcxx under MSan.



signature.asc
Description: OpenPGP digital signature