NetBSD-Users archive

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

Re: NetBSD-9.4 and SSP



On Sun, 20 Oct 2024 12:14:45 +0000 (UTC)
RVP <rvp%SDF.ORG@localhost> wrote:

> On Sun, 20 Oct 2024, Sad Clouds wrote:
> 
> > Configure script checks if getcwd() is implemented, doesn't find it and
> > provides its own implementation, which then conflicts with symbols in
> > /usr/include/ssp/unistd.h
> >
> > iffe: test: syscall(SYS_getcwd,buf,len) implemented ... no
> > iffe: test: is ( _lib_sysgetcwd ) true ... no
> > iffe: test: is ( _lib_sysgetcwd ) true ... no
> >
> 
> Fixed last year (2 different ways) in -HEAD:
> 
> http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/shells/ksh93/patches/patch-src_lib_libast_features_syscall?rev=1.4
> 
> and:
> 
> https://mail-index.netbsd.org/source-changes/2023/11/10/msg148488.html
> https://mail-index.netbsd.org/source-changes/2023/11/10/msg148487.html
> https://mail-index.netbsd.org/source-changes/2023/11/15/msg148509.html
> https://mail-index.netbsd.org/source-changes/2023/11/15/msg148508.html
> https://mail-index.netbsd.org/source-changes/2023/11/15/msg148507.html
> 
> -RVP

Hi, thanks for the pointers. Looks like wm/cde includes a copy of ksh,
so I applied the first patch you linked. It is still failing in the
same place, even after cleaning up all object files.

I logged the actual compiler command, see below. So removing
-D_FORTIFY_SOURCE=2 resolves the issue. If NetBSD getcwd() issue was
fixed back in 2023, how come this fix did not make to 9.4_STABLE?

# pwd
/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/arch/netbsd.sparc64-64/src/lib/libast
# gcc -O2 -fcommon -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -D_BLD_DLL -fPIC -D_BLD_ast -DSHOPT_DYNAMIC=1 -DSHOPT_NAMESPACE=1 -DSHOPT_MULTIBYTE=1 -DSHOPT_STATS=1 -DSHOPT_BGX=1 -DSHOPT_AUDIT=1 -DSHOPT_KIA=1 -DSHOPT_HISTEXPAND=1 -DSHOPT_EDPREDICT=1 -DSHOPT_ESH=1 -DSHOPT_VSH=1 -DSHOPT_FIXEDARRAY=1 -DSHOPT_SUID_EXEC=1 -DSHOPT_BRACEPAT=1 -DSHOPT_ECHOPRINT=1 -I. -I/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast -Icomp -I/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/comp -Idir -I/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/dir -Iinclude -I/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/include -Istd -I/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/std -D_PACKAGE_ast -c /opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/misc/getcwd
 .c -I/opt/netbsd/pkg
/opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/misc/getcwd.c:43:1: error: redefinition of 'getcwd'
 getcwd(char* buf, size_t len)
 ^~~~~~
In file included from /usr/include/ssp/strings.h:34:0,
                 from /usr/include/strings.h:72,
                 from /usr/include/string.h:98,
                 from ./ast_sys.h:10,
                 from /opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/include/ast_std.h:64,
                 from /opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/include/ast.h:32,
                 from /opt/netbsd/pkg.objects/wm/cde/work.ultra10/cde-2.5.2/programs/dtksh/ksh93/src/lib/libast/misc/getcwd.c:26:
/usr/include/ssp/unistd.h:45:1: note: previous definition of 'getcwd' was here
 __ssp_redirect_raw(char *, getcwd, getcwd, (char *__buf, size_t __len),




Home | Main Index | Thread Index | Old Index