bugGNU nano - Bugs: bug #50972, build on SunOS 5.10 fails with...

 
 

bug #50972: build on SunOS 5.10 fails with undefined symbol 'clock_gettime'

Submitted by:  John Wiersba <jrw>
Submitted on:  Mon 08 May 2017 05:09:18 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 17 May 2017 08:59:56 AM UTC, comment #10:

Build problem is fixed in git, cd7c3483. Thanks for reporting.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 17 May 2017 08:50:08 AM UTC, comment #9:

Okay, the build succeeds. But now we have a different problem: it segfaults. Please report a new bug and try to find where it segfaults -- attach there the result of 'strace src/nano 2>strace.log' and 'valgrind src/nano 2>valgrind.log'. Then build with --enable-debug and attach the output of 'src/nano 2>trail'. And if you have gdb, maybe get a backtrace too.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 16 May 2017 10:16:42 PM UTC, comment #8:

$ patch -i ../guiding-the-linker.patch -p0
$ ./configure --disable-nls CC=/bin/cc
$ /gnu/blah/make
$ src/nano
Segmentation Fault(coredump)

Attached config.h, config.log, make.log

(file #40718, file #40719, file #40720)

John Wiersba <jrw>
Tue 16 May 2017 07:34:54 AM UTC, comment #7:

Please try the attached patch. Apply with -p0, then (re)run ./configure and make.

(file #40707)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 10 May 2017 09:37:14 PM UTC, comment #6:

OK. I can wait. Thanks!

John Wiersba <jrw>
Wed 10 May 2017 07:17:54 PM UTC, comment #5:

Segmentation fault... Most interesting. :)

Yes, I think it needs instead something that autogen.sh suggests, something similar to this line:

nano_LDADD = @LIBINTL@ $(top_builddir)/lib/libgnu.a

(in src/Makefile.am). But I don't know precisely what. I will have to ask Mike. No time for that at the moment.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 10 May 2017 03:58:52 PM UTC, comment #4:

It builds but the result is not good.

$ LDFLAGS="-lrt" ./configure --disable-nls CC=/bin/cc
$ /gnu/dir/make
$ src/nano
Segmentation Fault

Also tried without the --disable-nls, but same result.

I've attached config.h.run3, config.log.run3, make.log.run3.

(file #40650, file #40651, file #40652)

John Wiersba <jrw>
Mon 08 May 2017 07:09:48 PM UTC, comment #3:

So, if you put LDFLAGS="-lrt" in front of ./configure, does it then build?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 08 May 2017 06:54:39 PM UTC, comment #2:

I see HAVE_CLOCK_GETTIME set to 1 in both config.h files. The output from running configure shows:

checking whether btowc(EOF) is correct... guessing yes
checking for __builtin_expect... no
checking for library containing clock_gettime... -lrt
checking for clock_gettime... yes
checking for clock_settime... yes
checking for closedir... yes

But I don't see -lrt in the make log.

John Wiersba <jrw>
Mon 08 May 2017 06:30:45 PM UTC, comment #1:

(CC'ing Mike, our gnulib expert.)

> Undefined first referenced
> symbol in file
> clock_gettime ../lib/libgnu.a(gettime.o)


Weird! It should only reference clock_gettime if HAVE_CLOCK_GETTIME is true, meaning it has detected the availability of the function. So either the test for this function doesn't work right, or in the final compilation a linking flag is missing. Mike?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 08 May 2017 05:09:18 PM UTC, original submission:

Building without any options to configure (only CC=/bin/cc) gives this (see attached config.h.run1, config.log.run1, make.log.run1):

run1:
/bin/cc -D_STDC_C99= -g -o nano browser.o chars.o color.o cut.o files.o global.o help.o move.o nano.o prompt.o rcfile.o search.o text.o utils.o winio.o /usr/local/lib/libintl.so -L/usr/local/lib -L/usr/openwin/lib -L/usr/X11R6/lib /usr/local/lib/libiconv.so -lsec -lc -R/usr/local/lib -R/usr/local/ssl/lib -R/usr/openwin/lib -R/usr/lib -R/usr/local/BerkeleyDB.4.2/lib -R/usr/X11R6/lib ../lib/libgnu.a -lz -lcurses
ld: warning: global symbol '_END_' has non-global binding:
(file /usr/local/lib/libiconv.so value=LOCL);
ld: warning: global symbol '_START_' has non-global binding:
(file /usr/local/lib/libiconv.so value=LOCL);
Undefined first referenced
symbol in file
clock_gettime ../lib/libgnu.a(gettime.o)
ld: fatal: symbol referencing errors. No output written to nano
make[2]: *** [Makefile:1514: nano] Error 2
make[2]: Leaving directory '/home/jrw32982/junk/nano-2.8.2/src'
make[1]: *** [Makefile:1521: all-recursive] Error 1
make[1]: Leaving directory '/home/jrw32982/junk/nano-2.8.2'
make: *** [Makefile:1460: all] Error 2

Next run, I tried configure --disable-nls (see attached config.h.run2, config.log.run2, make.log.run2):

run2:
/bin/cc -D_STDC_C99= -g -o nano browser.o chars.o color.o cut.o files.o global.o help.o move.o nano.o prompt.o rcfile.o search.o text.o utils.o winio.o ../lib/libgnu.a -lz -lcurses
Undefined first referenced
symbol in file
clock_gettime ../lib/libgnu.a(gettime.o)
ld: fatal: symbol referencing errors. No output written to nano
make[2]: *** [Makefile:1514: nano] Error 2
make[2]: Leaving directory '/home/jrw32982/junk/nano-2.8.2/src'
make[1]: *** [Makefile:1521: all-recursive] Error 1
make[1]: Leaving directory '/home/jrw32982/junk/nano-2.8.2'
make: *** [Makefile:1460: all] Error 2

John Wiersba <jrw>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40718:  config.h added by jrw (74KiB - application/octet-stream)
file #40719:  make.log added by jrw (70KiB - application/octet-stream)
file #40720:  config.log added by jrw (1MiB - application/octet-stream)
file #40707:  guiding-the-linker.patch added by bens (319B - text/x-diff)
file #40650:  config.h.run3 added by jrw (74KiB - application/octet-stream)
file #40651:  make.log.run3 added by jrw (70KiB - application/octet-stream)
file #40652:  config.log.run3 added by jrw (1MiB - application/octet-stream)
file #40619:  config.h.run1 added by jrw (74KiB - application/octet-stream)
file #40620:  config.h.run2 added by jrw (74KiB - application/octet-stream)
file #40615:  make.log.run1 added by jrw (71KiB - application/octet-stream)
file #40616:  config.log.run1 added by jrw (2MiB - application/octet-stream)
file #40617:  make.log.run2 added by jrw (70KiB - application/octet-stream)
file #40618:  config.log.run2 added by jrw (1MiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by bens (seems to be gnulib problem)
  • -unavailable- added by jrw (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 20 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 19 May 2017 10:12:47 AM UTCbensOpen/ClosedOpen=>Closed
    Wed 17 May 2017 08:59:55 AM UTCbensStatusIn Progress=>Fixed
    Wed 17 May 2017 08:50:08 AM UTCbensStatusNone=>In Progress
    Tue 16 May 2017 10:16:42 PM UTCjrwAttached File-=>Added config.h, #40718
      Attached File-=>Added make.log, #40719
      Attached File-=>Added config.log, #40720
    Tue 16 May 2017 08:09:48 PM UTCbensAssigned toNone=>bens
    Tue 16 May 2017 07:34:54 AM UTCbensAttached File-=>Added guiding-the-linker.patch, #40707
    Wed 10 May 2017 03:58:52 PM UTCjrwAttached File-=>Added config.h.run3, #40650
      Attached File-=>Added make.log.run3, #40651
      Attached File-=>Added config.log.run3, #40652
    Mon 08 May 2017 07:09:48 PM UTCbensSummarybuild on SunOS 5.10 fails=>build on SunOS 5.10 fails with undefined symbol 'clock_gettime'
    Mon 08 May 2017 06:30:45 PM UTCbensSummaryBuild on SunOS 5.10 fails=>build on SunOS 5.10 fails
      Carbon-Copy-=>Added vapier
    Mon 08 May 2017 05:09:47 PM UTCjrwAttached File-=>Added config.h.run1, #40619
      Attached File-=>Added config.h.run2, #40620
    Mon 08 May 2017 05:09:18 PM UTCjrwAttached File-=>Added make.log.run1, #40615
      Attached File-=>Added config.log.run1, #40616
      Attached File-=>Added make.log.run2, #40617
      Attached File-=>Added config.log.run2, #40618

    Back to the top


    Powered by Savane 3.1-cleanup1