From: <ch...@su...> - 2013-07-30 17:24:35
|
Hi! > I am building LTP for UCLINUX, and I went through an undefined symbol TEST_ERRNO with 'make UCLINUX=1'. > > As far as I understand, making with 'UCLINUX=1' defines also _USC_LIB_ in lib/Makefile: > > ifeq ($(UCLINUX),1) > CFLAGS += -D_USC_LIB_ > endif > > In include/usctest.h, if _USC_LIB_ is defined then TEST_ERRNO is declared as extern, hence still not defined: > > #ifdef _USC_LIB_ > extern int TEST_ERRNO; > #else That seems to be really messed up, so without UCLINUX the TEST_ERRNO is defined in the header which is included in the test and in the library. I wonder how that passes through the linker, that looks like redefinition to me... And with UCLINUX it's does not look to be defined anywhere. Hmm, we should really clean up this part. > Finally, the last place where TEST_ERRNO could be defined is in lib/parse_opts.c; if UNIT_TEST is somewhere defined: > > #if UNIT_TEST > int TEST_ERRNO; > ... > > So my questions are: should I compile with CFLAGS += -DUNIT_TEST=1? How to use parse_opts.c? > If you define the UNIT_TEST the parse_opts.c will contain main() (it's intended for testing the LTP lib interface only). -- Cyril Hrubis ch...@su... |