bugGNU nano - Bugs: bug #51348, building on AIX fails with...

 
 

bug #51348: building on AIX fails with "Undefined symbol: .pthread_mutex_init"

Submitted by:  Henrik Karlsson <heka>
Submitted on:  Fri 30 Jun 2017 11:54:38 AM 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)

Mon 24 Jul 2017 06:23:05 PM UTC, comment #14:

Thanks for confirming.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 24 Jul 2017 03:02:46 PM UTC, comment #13:

Yep, 2.8.6 configures and builds successfully with:
$ CC=cc ./configure
$ make
$ src/nano

Thanks!

John Wiersba <jrw>
Sat 22 Jul 2017 07:10:22 PM UTC, comment #12:

Version 2.8.6 should build without problems. Thanks for reporting, and for the testing.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 11 Jul 2017 08:14:17 PM UTC, comment #11:

Thanks, John. I've used the info to remove a duplicate include (commit 092174da), but for the rest... the warnings are so abundant that anything that might be useful is drowned out.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 06 Jul 2017 08:05:59 PM UTC, comment #10:

-qinfo=all is the closest to -Wall and -Werror, I think, based on web browsing.

-qinfo=all: Enables all diagnostic messages for all groups except als and ppt.

I replaced -Wall with -qinfo=all and rebuilt successfully. I've attached the output (10,000+ lines).

(file #41137)

John Wiersba <jrw>
Thu 06 Jul 2017 07:18:43 AM UTC, comment #9:

John, does xlC have something like -Werror (which turns warnings into errors)? If yes, then add that option to CFLAGS during ./configure, then the warnings will go away.

Currently, during ./configure you will see: "checking whether C compiler accepts -Wall... yes". If only xlC would reject -Wall instead of politely ignoring it, then ./configure would drop that option and you wouldn't get the warnings.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 05 Jul 2017 09:24:48 PM UTC, comment #8:

With earlier builds too. It happens since I'm using IBM's xlC and not gcc. xlC doesn't recognize -Wall.

John Wiersba <jrw>
Wed 05 Jul 2017 07:43:41 PM UTC, comment #7:

Thanks for testing, John. Change has been pushed to git, in commit 23f5515f. And thanks for reporting, Henrik.

About the -Wall not being recognized by your compiler: did you get this warning with earlier (regular) nano tarballs too, or just with this testing tarball?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 05 Jul 2017 07:01:29 PM UTC, comment #6:

After unpacking your tarball, I was able to run

$ ./configure CC=/usr/vacpp/bin/xlC
$ /usr/bin/make
$ src/nano
^X

successfully.

Note: I still get
/usr/vacpp/bin/xlC: 1501-289 (W) Option -Wall was incorrectly
specified. The option will be ignored.
for every compilation unit.

John Wiersba <jrw>
Mon 03 Jul 2017 08:14:23 PM UTC, comment #5:

Hrm, it doesn't want to take a tarball. So... it is here: https://nano-editor.org/dist/test/nano-2.8.5-plus.tar.gz

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 03 Jul 2017 08:08:00 PM UTC, comment #4:

Okay, I've rolled and attached a one-off tarball, with the patch applied. Please try building that.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Mon 03 Jul 2017 07:11:40 PM UTC, comment #3:

I get a similar result (nano 2.8.5, AIX 6.1, using xlC). If I use --disable-threads, I am able to get a working nano.

$ ./configure CC=/usr/vacpp/bin/xlC
...
$ make
...
/usr/vacpp/bin/xlC -g -Wall -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
/usr/vacpp/bin/xlC: 1501-289 (W) Option -Wall was incorrectly specified. The option will be ignored.
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: The error code from the last command is 8.
Stop.
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 2.
Stop.

Moving ahead, I applied the patch:
$ /gnustuff/patch -p1 <add-libthread-for-linking.patch
patching file src/Makefile.am
$ ./configure CC=/usr/vacpp/bin/xlC
...
$ make
...
cd .. && /bin/sh .../nano-2.8.5/missing automake-1.15 --gnu src/Makefile
.../nano-2.8.5/missing[81]: automake-1.15: not found
WARNING: 'automake-1.15' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: The error code from the last command is 127.
Stop.
make: The error code from the last command is 1.
Stop.
make: The error code from the last command is 2.
Stop.

I'm not sure why the patch to Makefile.am caused automake to be pulled in when it wasn't needed before. In any case, I have a limited number of gnu tools installed (and I'm not excited about installing more at this point).

Similarly to the OP (Henrik Karlsson), I can build a working nano if I re-run the original command with -lpthread added.

John Wiersba <jrw>
Mon 03 Jul 2017 07:40:13 AM UTC, comment #2:

I'm trying to build version 2.8.5.

If I configure with --disable-threads the build succeeds.

Unfortunately I can't run make after applying the patch because automake is not installed on the system. To install it I also need to install perl but I can't because the filesystem /opt has not enough space left and the guy how can help me with that is on vacation...

Henrik Karlsson <heka>
Sun 02 Jul 2017 08:13:26 AM UTC, comment #1:

Which version of nano are you trying to build? Does the build succeed when you configure with --disable-threads?

Without that option and after applying attached patch and running autogen.sh, does the build succeed?

(file #41103)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 30 Jun 2017 11:54:38 AM UTC, original submission:

When trying to build nano on AIX 7.2 I get this error:
gcc -std=gnu99 -g -O2 -Wall -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/lib/libintl.a ../lib/libgnu.a -lz -lcurses
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 1.

Stop.
make: 1254-004 The error code from the last command is 2.

Stop.

If I add -lpthread and run gcc manually from the src folder and the run make again it runs ok. Could you please add -lpthread when building nano on AIX?

Henrik Karlsson <heka>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41137:  make_output.txt added by jrw (1MiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jrw (Posted a comment)
  • -unavailable- added by bens (Updated the item)
  • -unavailable- added by heka (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 22 Jul 2017 07:10:22 PM UTCbensOpen/ClosedOpen=>Closed
    Thu 06 Jul 2017 08:05:59 PM UTCjrwAttached File-=>Added make_output.txt, #41137
    Wed 05 Jul 2017 07:43:41 PM UTCbensStatusNeed Info=>Fixed
    Mon 03 Jul 2017 08:08:00 PM UTCbensStatusNone=>Need Info
    Sun 02 Jul 2017 08:13:26 AM UTCbensAttached File-=>Added add-libthread-for-linking.patch, #41103
      Assigned toNone=>bens
      SummaryUndefined symbol: .pthread_mutex_init=>building on AIX fails with "Undefined symbol: .pthread_mutex_init"

    Back to the top


    Powered by Savane 3.1-cleanup1