rurban / safeclib

safec libc extension with all C11 Annex K functions
https://rurban.github.io/safeclib/
Other
339 stars 67 forks source link

Build issue on RHEL 8.6 #135

Open sudha-zetta opened 8 months ago

sudha-zetta commented 8 months ago

Hi,

I am trying to build this library on RHEL 8.6, using the master branch as of today.

./build-aux/autogen.sh ./configure

I ran make and make install, they ran without errors. But when I link against libsafec, I see these 2 errors which I am investigating.

libest/libest-source/src/est/.libs/libest.so: undefined reference to memzero_s' libest/libest-source/src/est/.libs/libest.so: undefined reference tomemcpy_s' collect2: error: ld returned 1 exit status

When I check the config.log, I see this error

configure:19287: result: no configure:19287: checking for memzero_s configure:19287: gcc -o conftest -O2 -D_FORTIFY_SOURCE=2 conftest.c >&5 /tmp/ccI0LrQJ.o: In function main': conftest.c:(.text.startup+0x7): undefined reference tomemzero_s' collect2: error: ld returned 1 exit status configure:19287: $? = 1 configure: failed program was:

configure:19247: result: no configure:19266: checking for _memcpy_s_chk configure:19266: gcc -o conftest -O2 -D_FORTIFY_SOURCE=2 conftest.c >&5 /tmp/ccQ5cu5d.o: In function main': conftest.c:(.text.startup+0x7): undefined reference to_memcpy_s_chk' collect2: error: ld returned 1 exit status configure:19266: $? = 1 configure: failed program was:

I see a bunch of the functions that are undefined as well.

conftest.c:(.text.startup+0x7): undefined reference to _snprintf_s_chk' conftest.c:(.text.startup+0x7): undefined reference to_vfprintf_s_chk' conftest.c:(.text.startup+0x7): undefined reference to _vsprintf_s_chk' conftest.c:(.text.startup+0x7): undefined reference to_vsnprintf_s_chk' conftest.c:(.text.startup+0x7): undefined reference to memset_s' conftest.c:(.text.startup+0x7): undefined reference tomemcpy_s' conftest.c:(.text.startup+0x7): undefined reference to memmove_s' conftest.c:(.text.startup+0x7): undefined reference tomemzero_s' conftest.c:(.text.startup+0x7): undefined reference to memchr_s' conftest.c:(.text.startup+0x7): undefined reference tomemrchr_s' conftest.c:(.text.startup+0x7): undefined reference to memccpy_s' conftest.c:(.text.startup+0x7): undefined reference tosprintf_s' conftest.c:(.text.startup+0x7): undefined reference to strcat_s' conftest.c:(.text.startup+0x7): undefined reference tostrcpy_s' conftest.c:(.text.startup+0x7): undefined reference to strncat_s' conftest.c:(.text.startup+0x7): undefined reference tostrncpy_s' conftest.c:(.text.startup+0x7): undefined reference to strnlen_s' conftest.c:(.text.startup+0x7): undefined reference tostrtok_s' conftest.c:(.text.startup+0x7): undefined reference to strerror_s' conftest.c:(.text.startup+0x7): undefined reference tovsprintf_s' conftest.c:(.text.startup+0x7): undefined reference to tmpnam_s' conftest.c:(.text.startup+0x7): undefined reference tosnprintf_s' conftest.c:(.text.startup+0x7): undefined reference to `vsnprintf_s' etc

Did configure work as expected? or Do I have to pass any arguments to it?

Thanks, Sudha

sudha-zetta commented 8 months ago

Here is nm results

[root@rhat862dev lib]# nm /usr/local/lib/libsafec.so | grep memzero_s 00000000000184c0 T _memzero_s_chk [root@rhat862dev lib]# nm /usr/local/lib/libsafec.so | grep memcpy_s 0000000000008000 T _memcpy_s_chk 0000000000010920 T _wmemcpy_s_chk [root@rhat862dev lib]#