Ticket #317 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

r36594 - build fails on solaris

Reported by: jsut Owned by: rurban
Priority: normal Milestone:
Component: none Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: applied Platform: solaris

Description

$ make
Compiling with:
xx.c
gcc -I./include -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Werror=declaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DHAS_GETTEXT -g -DHAVE_COMPUTED_GOTO -fPIC -I. -o xx.o -c xx.c
g++ -o miniparrot src/main.o src/null_config.o \
        -Wl,-rpath=/opt/parrot/blib/lib -L/opt/parrot/blib/lib -lparrot  -lsocket -lnsl -ldl -lm -lpthread -lrt -lintl
ld: fatal: option -dn and -P are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status
make: *** [miniparrot] Error 1

$ ld -V
GNU ld (GNU Binutils) 2.18
  Supported emulations:
   elf_i386_ldso
   elf_i386
   elf_x86_64

$ uname -a
SunOS web01-dev 5.10 Generic_127112-11 i86pc i386 i86pc Solaris

$ gcc -v
Using built-in specs.
Target: i386-pc-solaris2.10
Configured with: ./configure --prefix=/oanda/system --with-local-prefix=/oanda/system --enable-languages=c,c++ --with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld --with-ld=/usr/ccs/bin/ld
Thread model: posix
gcc version 4.2.1

if there is any other info I can provide, let me know.

Attachments

rpath.patch Download (0.8 KB) - added by doughera 6 years ago.
Patch replacing -Wl,-rpath= with a plain -R.

Change History

follow-up: ↓ 2   Changed 6 years ago by rurban

  • status changed from new to assigned
  • owner set to rurban

What are your Configure.pl args?

I usually build for gcc with --cc=gcc --ccflags= --link=ld

in reply to: ↑ 1   Changed 6 years ago by jsut

I was attempting to build with no arguments to configure, the output of Configure.pl is below. If i run Configure.pl with the arguments you list, i get errors. I tried a couple of variations, and it kept blowing up. I've also svn updated to 36634 and the build is still failing the same way.

perl Configure.pl
Parrot Version 0.9.0 Configure 2.0
Copyright (C) 2001-2009, The Perl Foundation.

Hello, I'm Configure. My job is to poke and prod your system to figure out
how to build Parrot. The process is completely automated, unless you passed in
the `--ask' flag on the command line, in which case I'll prompt you for a few
pieces of info.

Since you're running this program, you obviously have Perl 5--I'll be pulling
some defaults from its configuration.

init::manifest -      Check MANIFEST.....................................done.
init::defaults -      Set Configure's default values.....................done.
init::install -       Set up installation paths..........................done.
init::hints -         Load platform and local hints files................done.
init::headers -       Find header files distributed with Parrot..........done.
inter::progs -        Determine what C compiler and linker to use........done.
inter::make -         Is make installed...................................yes.
inter::lex -          Is lex installed................................skipped.
inter::yacc -         Is yacc installed...............................skipped.
auto::gcc -           Is your C compiler actually gcc................yes, 4.2.
auto::glibc -         Is GNU libc installed................................no.
auto::backtrace -     Does libc have the backtrace* functions..............no.
auto::fink -          Determine Fink location on Darwin...............skipped.
auto::macports -      Determine Macports location on Darwin...........skipped.
auto::msvc -          Is your C compiler actually Visual C++..........skipped.
auto::attributes -    Detect compiler attributes.........................done.
auto::warnings -      Detect supported compiler warnings..........set for gcc.
init::optimize -      Enable optimization..................................no.
inter::shlibs -       Determine flags for building shared libraries.....-fPIC.
inter::libparrot -    Should parrot link against a shared library.........yes.
inter::charset -      Which charset files should be compiled in..........done.
inter::encoding -     Which encoding files should be compiled in.........done.
inter::types -        What types should Parrot use.......................done.
auto::ops -           Which opcode files should be compiled in...........done.
auto::pmc -           Which pmc files should be compiled in..............done.
auto::alignptrs -     Determine your minimum pointer alignment........ 1 byte.
auto::headers -       Probe for C headers................................done.
auto::sizes -         Determine some sizes...............................done.
auto::byteorder -     Compute native byteorder for wordsize.....little-endian.
auto::va_ptr -        Test the type of va_ptr...........................stack.
auto::format -        What formats should be used for sprintf............done.
auto::isreg -         Does your C library have a working S_ISREG..........yes.
auto::arch -          Determine CPU architecture and OS..................done.
auto::jit -           Determine JIT capability.............................no.
auto::cpu -           Generate CPU specific stuff........................done.
auto::funcptr -       Does compiler support function pointer casts.......done.
auto::cgoto -         Does your compiler support computed goto............yes.
auto::inline -        Does your compiler support inline...................yes.
auto::gc -            Determine allocator to use.........................done.
auto::memalign -      Does your C library support memalign................yes.
auto::signal -        Determine some signal stuff........................done.
auto::socklen_t -     Determine whether there is socklen_t................yes.
auto::env -           Does your C library have setenv / unsetenv.........both.
auto::gmp -           Does your platform support GMP.....................done.
auto::readline -      Does your platform support readline................done.
auto::gdbm -          Does your platform support gdbm.....................yes.
auto::pcre -          Does your platform support pcre....................done.
auto::opengl -        Does your platform support OpenGL....................no.
auto::crypto -        Does your platform support crypto...........yes, 0.9.8g.
auto::gettext -       Does your configuration include gettext.............yes.
auto::snprintf -      Test snprintf......................................done.
auto::perldoc -       Is perldoc installed................................yes.
auto::pod2man -       Is pod2man installed................................yes.
auto::ctags -         Is (exuberant) ctags installed.......................no.
auto::revision -      Determine Parrot's revision......................r36634.
auto::icu -           Is ICU installed..........................no icu-config.
gen::config_h -       Generate C headers.................................done.
gen::core_pmcs -      Generate core pmc list.............................done.
gen::crypto -         Generate Digest PMC files..........................done.
gen::parrot_include - Generate runtime/parrot/include....................done.
gen::opengl -         Generating OpenGL bindings......................skipped.
gen::call_list -      Generate NCI signature list........................done.
gen::languages -      Configure languages................................done.
gen::makefiles -      Generate makefiles and other build files...........done.
gen::platform -       Move platform files into place.....................done.
gen::config_pm -      Record configuration data for later retrieval......done.
Okay, we're done!

You can now use `make' to build your Parrot.
After that, you can use `make test' to run the test suite.

Happy Hacking,
        The Parrot Team

myconfig:
Summary of my parrot 0.9.0 (r36634) configuration:
  configdate='Thu Feb 12 15:35:26 2009 GMT'
  Platform:
    osname=solaris, archname=i86pc-solaris
    jitcapable=0, jitarchname=nojit,
    jitosname=solaris, jitcpuarch=i86pc
    execcapable=0
    perl=perl
  Compiler:
    cc='gcc', ccflags=' -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT  -falign-functions=16 -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Werror=declaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DHAS_GETTEXT',
  Linker and Libraries:
    ld='gcc', ldflags=' ',
    cc_ldflags='',
    libs='-lsocket -lnsl -ldl -lm -lpthread -lrt -lintl'
  Dynamic Linking:
    share_ext='.so', ld_share_flags='-G',
    load_ext='.so', ld_load_flags='-G'
  Types:
    iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
    ptrsize=4, ptr_alignment=1 byteorder=1234,
    nv=double, numvalsize=8, doublesize=8

  Changed 6 years ago by doughera

I think the problem is that you're using Sun's ld, but the hints file incorrectly assumes you're using an ld that understands the -rpath syntax.

Probably the best fix is to have parrot just use the -R syntax on Solaris. I believe (but haven't verified) that GNU's ld on Solaris will handle -R. Alternatively, Configure.pl could probe and figure out which flavor of ld is being used and set flags accordingly. This is doable (Perl 5's Configure does this) but probably unnecessary for this one flag.

I've attached a patch that just uses -R. Does that help?

Changed 6 years ago by doughera

Patch replacing -Wl,-rpath= with a plain -R.

  Changed 6 years ago by doughera

I can confirm I hit the same error message on Solaris/SPARC. I think my rpath.patch (attached) will fix it for me and for the original poster, but I can't test if it will fix it for those who are using GNU ld.

  Changed 6 years ago by jsut

I just updated to r36813 and applied that patch, and now the build fails for me at a different point.

make[1]: Leaving directory `/opt/parrot/compilers/pct'
make -C compilers/pge
make[1]: Entering directory `/opt/parrot/compilers/pge'
perl -MExtUtils::Command -e rm_f PGE.pbc ../../runtime/parrot/library/PGE.pbc
perl -e "" >PGE/builtins_gen.pir
../../parrot -o PGE.pbc --output-pbc PGE.pir
../../parrot ../../runtime/parrot/library/PGE/Perl6Grammar.pir  --output=PGE/builtins_gen.pir PGE/builtins.pg
argument doesn't hash
current instr.: 'parrot;P6metaclass;register' pc 511 (runtime/parrot/library/P6object.pir:292)
called from Sub 'parrot;PGE;Match;' pc 18 (compilers/pge/PGE/Match.pir:18)
called from Sub 'parrot;PGE;Perl6Grammar;Compiler;__onload' pc 22 (../../runtime/parrot/library/PGE/Perl6Grammar.pir:72)
called from Sub 'parrot;PGE;Perl6Grammar;Compiler;main' pc -1 ((unknown file):-1)
make[1]: *** [PGE.pbc] Error 1
make[1]: Leaving directory `/opt/parrot/compilers/pge'
make: *** [compilers.dummy] Error 2

So it appears the rpath patch works, but I still have build issues.

  Changed 6 years ago by rurban

  • status changed from assigned to new

The original error was using -Wl,-rpath= instead of -Wl,--rpath= That's why we got the strange

ld: fatal: option -dn and -P are incompatible

error.

-R is a bit fragile on gcc:

  • -R FILE, --just-symbols FILE Just link symbols (if directory, same as --rpath)

If --rpath works on gcc we better stay with the original version and just fix the missing -

jsut's last PGE "argument doesn't hash" error is a known build problem. You have to update your root Makefile and/or rm src/call/*.str make realclean missed to clean that file for a short period.

  Changed 6 years ago by rurban

  • status changed from new to assigned
  • patch set to applied

Forget my last comment about -Wl,--rpath. I mixed that up.

rpath.patch applied as r36855

  Changed 6 years ago by jsut

r36860 builds fine on that box. Thanks.

  Changed 6 years ago by rurban

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.