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):

  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

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

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?  Or is it
a gnulib problem?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


Reply via email to