User account creation filtered due to spam.

Bug 28845 - configured --with-gnu-* reports unrecognized option '-rdynamic'
Summary: configured --with-gnu-* reports unrecognized option '-rdynamic'
Status: RESOLVED DUPLICATE of bug 37454
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2006-08-25 14:10 UTC by Pawel Sikora
Modified: 2010-04-28 20:51 UTC (History)
2 users (show)

See Also:
Target: sparc-sun-solaris2.9
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2006-08-25 14:10:44 UTC
with: ../configure --target=sparc-sun-solaris2.9
--with-gnu-as --with-gnu-ld
--disable-multilib --disable-nls --disable-libmudflap
--disable-libssp --disable-libstdcxx-pch --enable-shared
--enable-threads=posix --enable-languages=c,c++
Thread model: posix
gcc version 4.1.2 20060530 (prerelease) (PLD-Linux)

$ sparc-sun-solaris2.9-g++ -c /dev/null -rdynamic
sparc-sun-solaris2.9-g++: unrecognized option '-rdynamic'
sparc-sun-solaris2.9-g++: /dev/null: linker input file unused because
                          linking not done

-Wl,--export-dynamic works fine.
Comment 1 Andrew Pinski 2006-08-25 14:18:15 UTC
Solaris is not one of the targets that supports -rdynamic.
Comment 2 Pawel Sikora 2006-08-25 14:38:07 UTC
please look at this.

[1] cross build on linux machine:

sparc-sun-solaris2.9-g++ backtracexx.cpp -o -shared -ldl -Wall -Werror -pedantic \
        -O3 -fpic -funwind-tables -fno-exceptions -fno-rtti

sparc-sun-solaris2.9-g++ example.cpp -o example ./ -Wall -Werror -pedantic \
        -O1 -funwind-tables -Wl,--export-dynamic

[2] run on soalris:

$ uname -a
SunOS hermes 5.9 Generic_117171-07 sun4u sparc SUNW,Sun-Blade-1500

$ ./example
        0xff381118 : backtracexx::scan()+0x20
                     from /home/pawels/backtracexx/
           0x10bb0 : zoo()+0xc from /home/pawels/backtracexx/example
           0x10ad4 : bar(void (*)())+0x4 from /home/pawels/backtracexx/example
           0x10aec : foo()+0x8 from /home/pawels/backtracexx/example
           0x10b00 : main+0x4 from /home/pawels/backtracexx/example
           0x10968 : _start+0x5c from /home/pawels/backtracexx/example

$ file example
example:           ELF 32-bit MSB executable, SPARC, version 1 (SYSV),
                   dynamically linked (uses shared libs), not stripped ELF 32-bit MSB shared object, SPARC, version 1 (SYSV),
                   not stripped

without -Wl,--export-dynamic i get:

$ ./example
        0xff381118 : backtracexx::scan()+0x20
                     from /home/pawels/backtracexx/
           0x10aa4 : _init+0x2c0 from /home/pawels/backtracexx/example
           0x109c8 : _init+0x1e4 from /home/pawels/backtracexx/example
           0x109e0 : _init+0x1fc from /home/pawels/backtracexx/example
           0x109f4 : _init+0x210 from /home/pawels/backtracexx/example
           0x1085c : _init+0x78 from /home/pawels/backtracexx/example

cross-binutils for sparc-solaris supports --export-dynamic.
Comment 3 Andrew Pinski 2006-08-25 14:43:08 UTC
So read the docs, solaris does not support the option.
Comment 4 Pawel Sikora 2010-04-28 20:51:18 UTC
to mark 'as fixed'...
Comment 5 Pawel Sikora 2010-04-28 20:51:49 UTC

*** This bug has been marked as a duplicate of 37454 ***