Hi Eric,
Eric Blake wrote:
> While trying to build m4.git with clang on a Fedora 40 machine, and
> with gnulib updated to the latest git commit, I'm hitting the
> following during 'make check' (building with gcc worked):
The same build configuration (clang on Fedora 40) works for me,
except for a "test-driver: invalid option: '--collect-skipped-logs'"
error at a later point.
> CC test-gettimeofday.o
> CCLD test-gettimeofday
> /usr/bin/ld: test-gettimeofday.o: in function `main':
> /home/eblake/m4-tmp/tests/test-gettimeofday.c:44:(.text+0x46): undefined
> reference to `rpl_gettimeofday'
> /usr/bin/ld: /home/eblake/m4-tmp/tests/test-gettimeofday.c:60:(.text+0x6c):
> undefined reference to `rpl_gettimeofday'
> /usr/bin/ld: /home/eblake/m4-tmp/tests/test-gettimeofday.c:62:(.text+0x8a):
> undefined reference to `rpl_gettimeofday'
> /usr/bin/ld: libtests.a(time.o): in function `rpl_time':
> /home/eblake/m4-tmp/tests/time.c:33:(.text+0xe): undefined reference to
> `rpl_gettimeofday'
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> make[5]: *** [Makefile:6925: test-gettimeofday] Error 1
>
> Grepping build logs shows:
>
> config.log:
> ac_cv_func_gettimeofday=yes
> gl_cv_func_gettimeofday_posix_signature=yes
> GL_COND_OBJ_GETTIMEOFDAY_FALSE=''
> GL_COND_OBJ_GETTIMEOFDAY_TRUE='#'
> GL_M4_GNULIB_GETTIMEOFDAY='IN_M4_GNULIB_TESTS'
> HAVE_GETTIMEOFDAY='1'
> REPLACE_GETTIMEOFDAY='0'
> #define HAVE_GETTIMEOFDAY 1
> #define GETTIMEOFDAY_TIMEZONE void
> #define GNULIB_TEST_GETTIMEOFDAY 1
Same for me.
> Makefile.in:
> GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
> HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
> REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
>
> Makefile:
> GL_M4_GNULIB_GETTIMEOFDAY = IN_M4_GNULIB_TESTS
> HAVE_GETTIMEOFDAY = 1
> REPLACE_GETTIMEOFDAY = 0
Same for me.
> Is this a case of a missing LDFLAGS in m4's tests/Makefile.am (which
> right now only includes gnulib.mk) or top-level Makefile.am?
No, rpl_gettimeofday is not meant to come from an external library.
Here's what I have:
$ nm tests/time.o
U abort
U gettimeofday
0000000000000000 T rpl_time
I would guess that you have some left-over files in your source or
build directory, and would suggest to do
$ make distclean
$ rm -f lib/sys/time.h tests/sys/time.h
$ rm -f `find . -type l`
in both the source and the build directory, before re-running 'bootstrap'.
Bruno