On Wed, 2019-04-10 at 16:15 +0200, Thomas Hildebrandt - SSE - Oracle EMEA Support Services wrote: > Gents, > > having compiled and used openconnect for years and years (approx. since > 3.x) without ever having trouble compiling it on any of the OSses I used > and have used in the past, I was amazed to find that in 8.02 it bombs > out on memset_s in auth-common.c:115 under Solaris 11.4 > > To save you the trouble and the torn-out hair, Solaris 11.4 needs a > particular extra #define to correctly make use of memset_s. This has to > go BEFORE the line that #includes <string.h> (cf. memory(3C) on Solaris > 11.4) > > Apparently, Solaris before 11.4 did not support memset_s, because on > Solaris 11.3 everything compiled as it always used to do. > > I finally got it to work once I did Hm... that didn't work for me. #define __STDC_WANT_LIB_EXT1__ 1 #include <string.h> int foo(char *foo, int len) { memset_s(foo, len, 0, len); } dwmw2@solaris:~/openconnect$ gcc -c -o test.o test.c test.c: In function 'foo': test.c:6:2: warning: implicit declaration of function 'memset_s' [-Wimplicit-function-declaration] memset_s(foo, len, 0, len); ^ This works though: dwmw2@solaris:~/openconnect$ gcc -c -o test.o test.c -D_STDC_C11_BCI dwmw2@solaris:~/openconnect$ That's supposed to get defined (in <sys/feature_tests.h>) if _STDC_C99 is set, but building with -std=c99 or -std=gnu99 doesn't help. That's with the CSW gcc 5.5.0. I see that 'pkg install gcc' is giving me a newer version; I'll try that. But ultimately, I suppose the check for memset_s probably needs to be a full compilation test, not just AC_CHECK_FUNC.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ openconnect-devel mailing list openconnect-devel@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/openconnect-devel