NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD-9.4 and SSP



On Mon, 21 Oct 2024, Sad Clouds wrote:

Yes, once I applied this patch
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/shells/ksh93/patches/patch-src_lib_libast_features_syscall?rev=1.4

The test succeeds, but gcc returns error "redefinition of 'getcwd'"
which is more of a NetBSD + SSP issue.


OK, refreshing my memory again, I see the purpose of that ksh93 patch: it's
to make ksh use the syscall (which on NetBSD is SYS___getcwd--for some reason)
instead of rolling its own. So, that patch alone w/o Christos's SSP patches
won't work if you compile with -D_FORTIFY_SOURCE=2 and any -On flags.

Please ask for pull-ups for this, or just edit

cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/misc/getcwd.c

and then skip that entire file on NetBSD, like so:

```
#ifndef __NetBSD__

contents of orig. file

#endif
```

That ought to work: NetBSD honours the `getcwd(NULL, 0)' extension to POSIX
(in fact all the BSDs and Linux do), so just use the impl. in the C library.

This looks like a regression from NetBSD-9.3, although I'm not sure if
-D_FORTIFY_SOURCE=2 flag was always there, or recently added with
pkgsrc-2024Q3.


You need an optimization flag also for this to manifest..

-RVP


Home | Main Index | Thread Index | Old Index