Project

General

Profile

Actions

Bug #3120

closed

Building on glibc 2.16 where clock_gettime() is in librt.so

Added by gzpapp@gmail.com 7 months ago. Updated 5 months ago.

Status:
Fixed
Priority:
Normal
Category:
build_autotools
Target version:
ASK QUESTIONS IN Forums:
No

Description

I'm trying to build 1.4.63 on glibc 2.16 where clock_gettime is in librt.so

[31/195] Linking target src/test_common
FAILED: src/test_common 
/pkg/bin/gcc  -o src/test_common src/test_common.p/t_test_common.c.o src/test_common.p/t_test_array.c.o src/test_common.p/t_t>
/pkg/bin/ld: src/test_common.p/log.c.o: in function `log_buffer_timestamp':
/home/gzp/build.pkg/lighttpd/build/1.4.63/../../src/1.4.63/src/log.c:104: undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status

and

[33/195] Linking target src/test_configfile
FAILED: src/test_configfile 
/pkg/bin/gcc  -o src/test_configfile src/test_configfile.p/t_test_configfile.c.o src/test_configfile.p/buffer.c.o src/test_co>
/pkg/bin/ld: src/test_configfile.p/log.c.o: in function `log_buffer_timestamp':
/home/gzp/build.pkg/lighttpd/build/1.4.63/../../src/1.4.63/src/log.c:104: undefined reference to `clock_gettime'
collect2: error: ld returned 1 exit status

I'm using meson and ninja for configuring/building.
(here in redmine could be a new category "build_meson" created?)

Found the block:

conf_data.set('HAVE_CLOCK_GETTIME', compiler.has_header_symbol('time.h', 'clock_gettime'))
clock_lib = []
if not(conf_data.get('HAVE_CLOCK_GETTIME'))
        if compiler.has_function('clock_gettime', args: defs + ['-lrt'], prefix: '#include <time.h>')
                conf_data.set('HAVE_CLOCK_GETTIME', true)
                clock_lib = [ compiler.find_library('rt') ]
        endif
endif

in src/meson.build for checking clock_gettime() but I have no clue how should I fix the problem.


Files

configure-1638890678.log (5.86 KB) configure-1638890678.log configure job gzpapp@gmail.com, 2021-12-07 17:44
build-1638890678.log (3.96 KB) build-1638890678.log build job gzpapp@gmail.com, 2021-12-07 17:44
src_meson.build.diff (677 Bytes) src_meson.build.diff gzpapp@gmail.com, 2021-12-07 20:21
Actions #1

Updated by gzpapp@gmail.com 7 months ago

wrote:

I'm trying to build 1.4.63 on glibc 2.16 where clock_gettime is in librt.so

I think I have found the solution. Patch attached against src/meson.build, please review.

Actions #2

Updated by gstrauss 7 months ago

glibc 2.16 was released in Jun 2012. https://sourceware.org/glibc/wiki/Glibc%20Timeline
Latest glibc release is glibc 2.34.

FYI, the first release of meson was Mar 2013.

Still, I am glad that lighttpd is being updated, even if some other parts of the system are ancient.

Thank you for the patch.

Actions #3

Updated by gstrauss 7 months ago

  • Category set to build_autotools
  • Status changed from New to Patch Pending
  • Target version changed from 1.4.xx to 1.4.64

(here in redmine could be a new category "build_meson" created?)

(probably should simply be a 'build' category)

Actions #4

Updated by gstrauss 7 months ago

  • Status changed from Patch Pending to Fixed
Actions #5

Updated by gzpapp@gmail.com 5 months ago

gstrauss wrote in #note-4:

Applied in changeset fae1c0519187cb263259990f7b2aa8fdbc2c374a.

Sorry for the delay, redmine messages landed in the spam folder.

The patch fixes the build problem.

Actions

Also available in: Atom