Ticket #1832 (closed bug: done)

Opened 11 years ago

Last modified 11 years ago

Build error

Reported by: JustinWyllie Owned by:
Priority: normal Milestone:
Component: none Version: 2.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: linux

Description

I'm on Red Hat Enterprise Linux ES release 4 Perl version: 5.8.8

perl Configure.pl seems ok then I run gmake as recommended and I get this:

/path/to/parrot2.6/parrot-2.6.0/src/null_config.c:29: undefined reference to `Parrot_set_config_hash_internal' collect2: ld returned 1 exit status make: *** [miniparrot] Error 1

Before this I get a bunch of errors like this:

/path/to/parrot2.6/parrot-2.6.0/src/main.c:176: undefined reference to `Parrot_confess'

Attachments

build_error.txt Download (10.1 KB) - added by JustinWyllie 11 years ago.
The output from gmake

Change History

  Changed 11 years ago by JustinWyllie

I tried again with parrot2.8 and got a very similar result. I'm attaching the errors output from that.

This is on a VPS system if that makes a difference - though I can usually build things.

  Changed 11 years ago by doughera

On Sun, 17 Oct 2010, Parrot wrote:

> #1832: Build error

>  I tried again with parrot2.8 and got a very similar result. I'm attaching
>  the errors output from that.

It would help a lot to see the few statements before the error -- i.e. 
what command was being executed that caused the error message.

It would also help to include the ./myconfig file from the build 
directory.

>  This is on a VPS system if that makes a difference - though I can usually
>  build things.

Sorry, but what's a "VPS system?"

-- 
    Andy Dougherty		doughera@lafayette.edu


Changed 11 years ago by JustinWyllie

The output from gmake

  Changed 11 years ago by JustinWyllie

A VPS = a Virtual Private Server. Several accounts on one machine each has virtual root access e.g. if I go cd / it looks like the top level of the server but it isn't really. I have my own apps but the kernel is shared.

This is myconfig:

Summary of my parrot 2.8.0 (r0) configuration:

configdate='Mon Oct 18 13:06:03 2010 GMT' Platform:

osname=linux, archname=i386-linux-thread-multi jitcapable=0, jitarchname=nojit, jitosname=linux, jitcpuarch=i386 execcapable=0 perl=/skel/usr/bin/perl

Compiler:

cc='gcc', ccflags='-D_REENTRANT -D_GNU_SOURCE -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHAS_GETTEXT',

Linker and Libraries:

ld='gcc', ldflags=' -L/usr/local/lib', cc_ldflags=, libs='-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp '

Dynamic Linking:

share_ext='.so', ld_share_flags='-shared -L/usr/local/lib -fPIC', load_ext='.so', ld_load_flags='-shared -L/usr/local/lib -fPIC'

Types:

iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, byteorder=1234, nv=double, numvalsize=8, doublesize=8, longdoublesize=12

~ ~

I'm attaching the errors starting from the last command (sorry about that).

  Changed 11 years ago by doughera

>gcc -o miniparrot src/main.o src/null_config.o \
>	-Wl,-rpath=/home/justvps1/parrot2.8/parrot-2.8.0/blib/lib -L/home/justvps1/parrot2.8>/parrot-2.8.0/blib/lib -lparrot  -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp  
> -L/usr/local/lib -Wl,-E
> 	src/main.o: In function `is_all_digits':
> 	/home/justvps1/parrot2.8/parrot-2.8.0/src/main.c:183: undefined reference to`Parrot_confess'

These error messages are what I'd expect if it couldn't find the right -lparrot (i.e. blib/lib/libparrot.so). (It apparently found some libparrot somewhere, otherwise the linker would have complained "cannot find -lparrot"). Can you confirm that /home/justvpsl/parrot2.8/parrot-2.8.0/blib/libparrot.so exists and contains the required symbols? For example, you could run

    nm blib/lib/libparrot.so | grep 'T Parrot_confess'

Is there perhaps another libparrot somewhere else on your system which it might be finding?

It might be helpful to run just that last failing command 'gcc -o miniperl ...' and add in a -v flag 'gcc -v -o miniperl ...' to see what, exactly, is happening.

follow-up: ↓ 6   Changed 11 years ago by JustinWyllie

I do have blib/lib/libparrot.so which is a symlink to blib/lib/libparrot.so.2.8.0

I ran the last failing command with the -V option and I get:

gcc: couldn't run `i386-redhat-linux-gcc--o': No such file or directory

I have i386-redhat-linux-gcc and can run it from within the parrot directory. I don't think it likes the --o option. It seems to be treating that as the whole filename and then not finding it. Should that not be i386-redhat-linux-gcc -o? Sorry; I'm really not knowledgeable about compiling C programs.

in reply to: ↑ 5   Changed 11 years ago by jkeenan

Replying to JustinWyllie:

I do have blib/lib/libparrot.so which is a symlink to blib/lib/libparrot.so.2.8.0 I ran the last failing command with the -V option and I get:

Justin, I think Andy wanted you to run the command with '-v' rather than '-V'. Was that just a typo in your post or was it a typo in the command you ran as well?

Thank you very much.

kid51

follow-up: ↓ 8   Changed 11 years ago by JustinWyllie

Thanks very much. Yes. A typo.

This is what I see with the -v flag:

Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux Thread model: posix gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)

/usr/libexec/gcc/i386-redhat-linux/3.4.6/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o miniparrot /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crt1.o /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crti.o /usr/lib/gcc/i386-redhat-linux/3.4.6/crtbegin.o -L/home/justvps1/parrot2.8/parrot-2.8.0/blib/lib -L/usr/local/lib -L/usr/lib/gcc/i386-redhat-linux/3.4.6 -L/usr/lib/gcc/i386-redhat-linux/3.4.6 -L/usr/lib/gcc/i386-redhat-linux/3.4.6/../../.. src/main.o src/null_config.o -rpath=/home/justvps1/parrot2.8/parrot-2.8.0/blib/lib -lparrot -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -E -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i386-redhat-linux/3.4.6/crtend.o /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crtn.o

Then, as before, the errors:

src/main.o: In function `is_all_digits': /home/justvps1/parrot2.8/parrot-2.8.0/src/main.c:183: undefined reference to `Parrot_confess' ....

It seems to give some information about how the compiler was compiled but I have to say nothing leaps out at me.

in reply to: ↑ 7   Changed 11 years ago by doughera

Replying to JustinWyllie:

Please also post what

 nm /home/justvps1/parrot2.8/parrot-2.8.0/blib/lib/libparrot.so | grep 'T Parrot_confess'

returns. Based on that, we can try to figure out where to proceed. As I said before, gcc is apparently picking up a libparrot somewhere that doesn't define Parrot_confess. We need to figure out if it's getting the correct library location, but that library is broken somehow, or if it's getting the wrong library from somewhere else.

  Changed 11 years ago by JustinWyllie

This returns nothing.

But nm libparrot.so returns a whole lot of symbols. So. It looks like this symbol 'Parrot_confess' is missing. There is definitely only one libparrot.so in my system and that is in /home/justvps1/parrot-2.8.0/blib/lib. libparrot.so is a symlink to libparrot.so.2.8.0 in that directory.

So. With my very basic knowledge of C when the compiler/linker built the object file it did not find a header file definition for that function and the others it can't find? Or something like that?

But I see what looks like a definition for Parrot_confess in /home/justvps1/parrot-2.8.0/include/parrot/exceptions.h

Just to recap (I tried again from the start so the paths are not exactly the same as in my first post) the command which produces the error is:

gcc -o miniparrot src/main.o src/null_config.o \ -Wl,-rpath=/home/justvps1/parrot-2.8.0/blib/lib -L/home/justvps1/parrot-2.8.0/blib/lib -lparrot -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -L/usr/local/lib -Wl,-E

and the error is:

src/main.o: In function `is_all_digits': /home/justvps1/parrot-2.8.0/src/main.c:183: undefined reference to `Parrot_confess'

follow-up: ↓ 11   Changed 11 years ago by JustinWyllie

OK. I was just producing the complete list of symbols and I noticed I do have a Parrot_confess. The nm command didn't find it because it is a lower case t.

So

nm /home/justvps1/parrot-2.8.0/blib/lib/libparrot.so | grep 't Parrot_confess'

returns:

00063100 t Parrot_confess

in reply to: ↑ 10   Changed 11 years ago by doughera

Replying to JustinWyllie:

nm /home/justvps1/parrot-2.8.0/blib/lib/libparrot.so | grep 't Parrot_confess' returns: 00063100 t Parrot_confess

That means the symbol is a local symbol, not a global one. I think I see what's happening here. I think the problem is the -fvisibility=hidden option passed to gcc. (See TT #1255 for what might be an earlier manifestation of this problem.)

You are using gcc-3.4.6. According to the gcc-3.4.6 docs on  http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Option-Summary.html, gcc-3.4.6 does not accept the -fvisibility=hidden option. However, your version appears to have been patched to accept it. This confuses Parrot's configure system, which adds visibility attributes, but only if the gcc version is >= 4.0.

The simplest workaround for you is probably to delete the line with -fvisibility=hidden in config/auto/warnings.pm and then re-run Configure.pl.

Longer term, parrot should couple the tests for the command line option -fvisibility and the attribute((visibility("default")).

follow-up: ↓ 13   Changed 11 years ago by JustinWyllie

Just reporting that this worked.

Thank you very much.

in reply to: ↑ 12   Changed 11 years ago by doughera

  • status changed from new to closed
  • resolution set to done

Replying to JustinWyllie:

Just reporting that this worked.

Thanks for the successful report. I have closed this ticket, but opened a new ticket TT #1862 for the specific -fvisibility=hidden issue that caused the trouble here.

Note: See TracTickets for help on using tickets.