Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 134162 - [4.1/bad-code?] #pragma GCC visibility causes non-PIC code generation
Summary: [4.1/bad-code?] #pragma GCC visibility causes non-PIC code generation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR26905
Whiteboard:
Keywords:
: 170289 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-23 18:23 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2009-05-01 01:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
rubytagpp.ii.bz2 (rubytagpp.ii.bz2,110.05 KB, application/x-bzip2)
2006-05-23 18:24 UTC, Diego Elio Pettenò (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2006-05-23 18:23:25 UTC
I know that visibility support is still unsafe, although upstream GCC and KDE continue saying that it's all well... I know GCC 4.1 seems to fix the -fvisibility-inlines-hidden problem with -fPIC.. but seems like #pragma still have issues.

I'm going to attach a (bzip2 compressed) copy of the preprocessed output generated by rubytag++, that, once compiled, fails badly:

flame@enterprise ~/tmp $ gcc -shared -fPIC rubytagpp.ii -o rubytagpp-test.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1-pre20060517/../../../../x86_64-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1-pre20060517/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/ccZUhVew.o: relocation R_X86_64_PC32 against `rb_define_module' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1-pre20060517/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status

Hope this can help to find what it's still wrong with it.

Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-05-23 18:24:52 UTC
Created attachment 87353 [details]
rubytagpp.ii.bz2
Comment 2 Mark Loeser (RETIRED) gentoo-dev 2006-05-26 22:44:31 UTC
Here's a reduced testcase.  I'll try to do some debugging and talk to upstream to make sure this isn't intended behaviour...I'm sure it isn't :)

#pragma GCC visibility push(hidden)
void rb_check_type (int, int);
class AudioProperties
{};

AudioProperties * ruby2TagLib_AudioPropertiesPtr (int rval)
{
    do
    {
        rb_check_type (rval, 0x22);
    } while (0);
}
Comment 3 Mark Loeser (RETIRED) gentoo-dev 2006-05-26 23:27:28 UTC
Actually, I think that testcase just shows another way to get a textrel...I'll have to look into this more.
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-03-10 17:54:29 UTC
*** Bug 170289 has been marked as a duplicate of this bug. ***
Comment 5 SpanKY gentoo-dev 2007-03-10 22:20:54 UTC
looks like it'll prob stay broken until gcc-4.2.0 is released ... the required changes are just too invasive for any one here to watch over
Comment 6 Mark Loeser (RETIRED) gentoo-dev 2007-12-09 03:07:03 UTC
Do we want to keep this open until gcc-4.2 is stable?  (Its in the tree atleast, and I'm pretty sure Diego was running ~arch to hit this bug when he did)
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-12-23 20:01:10 UTC
I'd close this since anyway 4.1 is broken a lot regarding visibility, so it's not much of a problem.
Comment 8 Mark Loeser (RETIRED) gentoo-dev 2009-05-01 01:16:16 UTC
Fixed in newer versions of gcc.