Re: libc/libsys split coming soon

2024-02-23 Thread Paul Floyd
On 05-02-24 17:02, Brooks Davis wrote: Could you do a quick test with an exe linked to libsys but not libc running under Valgrind memcheck, please? Could you suggest a more concrete example? This little example seems to be OK void _start(void) { _exit(0); } However I do see quite a

Re: sanitizers broken (was RE: libc/libsys split coming soon) [errno in libsys: any analogy to __elf_aux_vector ?]

2024-02-22 Thread Brooks Davis
On Thu, Feb 22, 2024 at 10:16:30AM -0800, Mark Millard wrote: > Brooks Davis wrote on > Date: Thu, 22 Feb 2024 02:03:09 UTC : > > > On Thu, Feb 22, 2024 at 02:57:13AM +0200, Konstantin Belousov wrote: > > > On Wed, Feb 21, 2024 at 08:20:25PM +, Brooks Davis wrote: > > > > That's probably wort

Re: sanitizers broken (was RE: libc/libsys split coming soon) [errno in libsys: any analogy to __elf_aux_vector ?]

2024-02-22 Thread Mark Millard
Brooks Davis wrote on Date: Thu, 22 Feb 2024 02:03:09 UTC : > On Thu, Feb 22, 2024 at 02:57:13AM +0200, Konstantin Belousov wrote: > > On Wed, Feb 21, 2024 at 08:20:25PM +, Brooks Davis wrote: > > > That's probably worth a shot. Static linking will work anyway because > > > libc.a in effect e

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-22 Thread Alexander Leidinger
Am 2024-02-21 10:52, schrieb hartmut.bra...@dlr.de: Hi, I updated yesterday and now event a minimal program with cc -fsanitize=address produces ld: error: undefined symbol: __elf_aux_vector referenced by sanitizer_linux_libcdep.cpp:950 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-22 Thread David Chisnall
On 21 Feb 2024, at 20:00, Brooks Davis wrote: > > The sanitizers reach somewhat questionably into libc internals that are > exported to allow rtld to update them. I was unable to find an solution > that didn't break this and I felt that fixing things like closefrom() > using non-deprecated sysca

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Brooks Davis
roduces > > > >> > > > >> ld: error: undefined symbol: __elf_aux_vector > > > >>>>> referenced by sanitizer_linux_libcdep.cpp:950 > > > >>>>> (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_lib

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Konstantin Belousov
tizer_common/sanitizer_linux_libcdep.cpp:950) > > >>>>> sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in > > >>>>> archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a > > >> cc: error: linker command failed with exit co

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Brooks Davis
a > >> cc: error: linker command failed with exit code 1 (use -v to see > >> invocation) > >> > >> I think this is caused by the libsys split. > >> > >> Cheers, > >> Harti > >> > >> -Original Message- &g

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Dimitry Andric
aused by the libsys split. >> >> Cheers, >> Harti >> >> -Original Message- >> From: owner-freebsd-curr...@freebsd.org >> On Behalf Of Brooks Davis >> Sent: Friday, February 2, 2024 11:32 PM >> To: curr...@freebsd.org >> Subject: li

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Brooks Davis
Original Message- > From: owner-freebsd-curr...@freebsd.org > On Behalf Of Brooks Davis > Sent: Friday, February 2, 2024 11:32 PM > To: curr...@freebsd.org > Subject: libc/libsys split coming soon > > TL;DR: The implementation of system calls is moving to a seperate libra

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Mark Millard
[Brooks' activity related to commit 99ea67573164637d633e8051eb0a5d52f1f9488e looks likely for what changed the status: "lib{c,sys}: move auxargs more firmly into libsys".] On Feb 21, 2024, at 09:02, Mark Millard wrote: > On Feb 21, 2024, at 08:38, Mark Millard wrote: > >> Mark Johnston wrote

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Mark Millard
On Feb 21, 2024, at 08:38, Mark Millard wrote: > Mark Johnston wrote on > Date: Wed, 21 Feb 2024 13:33:43 UTC : > >> On Wed, Feb 21, 2024 at 09:52:23AM +, hartmut.bra...@dlr.de wrote: >>> Hi, >>> >>> I updated yesterday and now event a minimal program with >>> >>> cc -fsanitize=address >>

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Mark Millard
Mark Johnston wrote on Date: Wed, 21 Feb 2024 13:33:43 UTC : > On Wed, Feb 21, 2024 at 09:52:23AM +, hartmut.bra...@dlr.de wrote: > > Hi, > > > > I updated yesterday and now event a minimal program with > > > > cc -fsanitize=address > > > > produces > > > > ld: error: undefined symbol: __

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Hartmut Brandt
MJ>> From: owner-freebsd-curr...@freebsd.org On Behalf Of Brooks Davis MJ>> Sent: Friday, February 2, 2024 11:32 PM MJ>> To: curr...@freebsd.org MJ>> Subject: libc/libsys split coming soon MJ>> MJ>> TL;DR: The implementation of system calls is moving to a seperate

Re: sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Mark Johnston
are you running? > Cheers, > Harti > > -Original Message- > From: owner-freebsd-curr...@freebsd.org > On Behalf Of Brooks Davis > Sent: Friday, February 2, 2024 11:32 PM > To: curr...@freebsd.org > Subject: libc/libsys split coming soon > > TL;DR: The

sanitizers broken (was RE: libc/libsys split coming soon)

2024-02-21 Thread Hartmut.Brandt
Cheers, Harti -Original Message- From: owner-freebsd-curr...@freebsd.org On Behalf Of Brooks Davis Sent: Friday, February 2, 2024 11:32 PM To: curr...@freebsd.org Subject: libc/libsys split coming soon TL;DR: The implementation of system calls is moving to a seperate library (libsys).

Re: libc/libsys split coming soon

2024-02-05 Thread Paul Floyd
Hi > On 5 Feb 2024, at 17:02, Brooks Davis wrote: > > >>> 2. It simplifies the implementation of restrictions on system calls such >>> as those implemented by OpenBSD's msyscall(2) >>> (https://man.openbsd.org/msyscall.2). >> >> That's one to ignore for tools that make syscalls out

Re: libc/libsys split coming soon

2024-02-05 Thread Brooks Davis
On Sat, Feb 03, 2024 at 10:15:09AM +0100, Mateusz Guzik wrote: > On 2/2/24, Brooks Davis wrote: > > TL;DR: The implementation of system calls is moving to a seperate > > library (libsys). No changes are required to existing software (except > > to ensure that libsys is present when building custo

Re: libc/libsys split coming soon

2024-02-05 Thread Brooks Davis
On Sat, Feb 03, 2024 at 05:11:42PM +0100, Paul Floyd wrote: > > On 02/02/2024 23:31, Brooks Davis wrote: > > TL;DR: The implementation of system calls is moving to a seperate > > library (libsys). No changes are required to existing software (except > > to ensure that libsys is present when build

Re: libc/libsys split coming soon

2024-02-03 Thread Konstantin Belousov
On Sat, Feb 03, 2024 at 11:10:14AM -0700, Warner Losh wrote: > On Sat, Feb 3, 2024, 11:02 AM Konstantin Belousov > wrote: > > > On Sat, Feb 03, 2024 at 11:05:10AM -0500, Daniel Eischen wrote: > > > Will this break binary compatibility with older programs expecting those > > symbols in libc and no

Re: libc/libsys split coming soon

2024-02-03 Thread Warner Losh
On Sat, Feb 3, 2024, 11:02 AM Konstantin Belousov wrote: > On Sat, Feb 03, 2024 at 11:05:10AM -0500, Daniel Eischen wrote: > > Will this break binary compatibility with older programs expecting those > symbols in libc and not linked to libsys? > > As was mentioned, libc filters libsys. This mean

Re: libc/libsys split coming soon

2024-02-03 Thread Konstantin Belousov
On Sat, Feb 03, 2024 at 11:05:10AM -0500, Daniel Eischen wrote: > Will this break binary compatibility with older programs expecting those > symbols in libc and not linked to libsys? As was mentioned, libc filters libsys. This means that libc exports all the same symbols as before, but forward t

Re: libc/libsys split coming soon

2024-02-03 Thread Konstantin Belousov
On Sat, Feb 03, 2024 at 12:12:35PM +0100, Mateusz Guzik wrote: > On 2/3/24, David Chisnall wrote: > > On 3 Feb 2024, at 09:15, Mateusz Guzik wrote: > >> > >> Binary startup is very slow, for example execve of a hello world > >> binary in a Linux-based chroot on FreeBSD is faster by a factor of 2

Re: libc/libsys split coming soon

2024-02-03 Thread Paul Floyd
On 02/02/2024 23:31, Brooks Davis wrote: TL;DR: The implementation of system calls is moving to a seperate library (libsys). No changes are required to existing software (except to ensure that libsys is present when building custom disk images). Code:https://github.com/freebsd/freebsd-src/pull

Re: libc/libsys split coming soon

2024-02-03 Thread Daniel Eischen
Will this break binary compatibility with older programs expecting those symbols in libc and not linked to libsys? > On Feb 3, 2024, at 3:39 AM, Dave Cottlehuber wrote: > > On Fri, 2 Feb 2024, at 23:31, Brooks Davis wrote: >> TL;DR: The implementation of system calls is moving to a seperate >>

Re: libc/libsys split coming soon

2024-02-03 Thread Robert Clausecker
Am Sat, Feb 03, 2024 at 10:15:09AM +0100 schrieb Mateusz Guzik: > Do I read it correctly that everything dynamically linked will also be > linked to libsys, as in executing such a binary will now require > loading one extra .so? > > Binary startup is very slow, for example execve of a hello world

Re: libc/libsys split coming soon

2024-02-03 Thread Mateusz Guzik
On 2/3/24, David Chisnall wrote: > On 3 Feb 2024, at 09:15, Mateusz Guzik wrote: >> >> Binary startup is very slow, for example execve of a hello world >> binary in a Linux-based chroot on FreeBSD is faster by a factor of 2 >> compared to a native one. As such perf-wise this looks like a step in

Re: libc/libsys split coming soon

2024-02-03 Thread David Chisnall
On 3 Feb 2024, at 09:15, Mateusz Guzik wrote: > > Binary startup is very slow, for example execve of a hello world > binary in a Linux-based chroot on FreeBSD is faster by a factor of 2 > compared to a native one. As such perf-wise this looks like a step in > the wrong direction. Have you profil

Re: libc/libsys split coming soon

2024-02-03 Thread Mateusz Guzik
On 2/2/24, Brooks Davis wrote: > TL;DR: The implementation of system calls is moving to a seperate > library (libsys). No changes are required to existing software (except > to ensure that libsys is present when building custom disk images). > > Code: https://github.com/freebsd/freebsd-src/pull/9

Re: libc/libsys split coming soon

2024-02-03 Thread Dave Cottlehuber
On Fri, 2 Feb 2024, at 23:31, Brooks Davis wrote: > TL;DR: The implementation of system calls is moving to a seperate > library (libsys). No changes are required to existing software (except > to ensure that libsys is present when building custom disk images). > > Code: https://github.com/freebsd/

Re: libc/libsys split coming soon

2024-02-02 Thread Steffen Nurpmeso
Brooks Davis wrote in : |TL;DR: The implementation of system calls is moving to a seperate |library (libsys). No changes are required to existing software (except |to ensure that libsys is present when building custom disk images). ... [] |This change serves three primary purposes: | 1

libc/libsys split coming soon

2024-02-02 Thread Brooks Davis
TL;DR: The implementation of system calls is moving to a seperate library (libsys). No changes are required to existing software (except to ensure that libsys is present when building custom disk images). Code: https://github.com/freebsd/freebsd-src/pull/908 After nearly a decade of intermittent