Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xorg vs hardened, pie et. al., and unresolved symbols
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
kevquinn
Retired Dev
Retired Dev


Joined: 27 Jun 2003
Posts: 52

PostPosted: Sat Jul 03, 2004 3:19 pm    Post subject: xorg vs hardened, pie et. al., and unresolved symbols Reply with quote

I found that the only way I can get X to install without the strange symbol unresolved errors, is to remove hardened, pic and pie from the use flags, re-build gcc!, clear the ccache (ccache -C) just in case, then build xorg-x11 with the same. Then I put 'hardened pic pie' back into make.conf and rebuild gcc again... The big point is that the only way to get it to build was to rebuild gcc first! Trying to build just xorg-x11 without the hardened flags didn't solve anything; rebuilding gcc was necessary.

Obviously, there may be a smaller set. Perhaps removing hardened from gcc then just pie from xorg-x11 - but frankly it gets very boring rebuilding all this just to try things out!

Whoops - this was meant to be a reply to the xorg-x11 sticky topic, not a new one :/
Back to top
View user's profile Send private message
tomaw
Guru
Guru


Joined: 26 Mar 2003
Posts: 429
Location: UK

PostPosted: Sat Jul 03, 2004 4:42 pm    Post subject: Reply with quote

You might be interested in this bug and those linked off of it.
_________________
Tom Wesley
Back to top
View user's profile Send private message
kevquinn
Retired Dev
Retired Dev


Joined: 27 Jun 2003
Posts: 52

PostPosted: Mon Jul 05, 2004 6:55 am    Post subject: Reply with quote

Interesting; that bug report says the dlloader is unsupported. Yet it's built that way by default (I didn't do anything to request the dllloader).

Freedesktop implies it's mostly down to sloppy programming in the drivers.

I'm not sure, but the root problem I had that required rebuilding gcc might be different; with "USE=-pie", the unresolved symbols in the graphics driver went away (on both my nvidia desktop and the ati laptop), but a single unresolved symbol remained, which didn't go away until I rebuilt gcc. Unfortunately I've lost the log :?

I'll have to find time to regenerate the error, I suppose.
Back to top
View user's profile Send private message
spudicus
Apprentice
Apprentice


Joined: 05 Dec 2002
Posts: 177
Location: Geraldton, Australia

PostPosted: Tue Jul 06, 2004 3:41 am    Post subject: Reply with quote

I had the same problem but was (finally) able to emerge xorg with hardened/pie USE flags after following Solar's advice i.e. compiled xorg statically
Code:
USE="hardened pie static" emerge -av xorg-x11
Back to top
View user's profile Send private message
HydroSan
l33t
l33t


Joined: 04 Mar 2004
Posts: 764
Location: The Kremlin (aka Canada)

PostPosted: Tue Jul 06, 2004 3:54 am    Post subject: Reply with quote

spudicus wrote:
I had the same problem but was (finally) able to emerge xorg with hardened/pie USE flags after following Solar's advice i.e. compiled xorg statically
Code:
USE="hardened pie static" emerge -av xorg-x11


IIRC, Static just compiles all modules into the binary, right? That would solve any module loading problems, wouldn't it? :D
_________________
I was a Gangster for Capitalism, by Major General Smedley Butler.

Server status: Currently down, being replaced with fresh install - 20% completed.
Back to top
View user's profile Send private message
spudicus
Apprentice
Apprentice


Joined: 05 Dec 2002
Posts: 177
Location: Geraldton, Australia

PostPosted: Tue Jul 06, 2004 5:24 am    Post subject: Reply with quote

HydroSan wrote:
spudicus wrote:
I had the same problem but was (finally) able to emerge xorg with hardened/pie USE flags after following Solar's advice i.e. compiled xorg statically
Code:
USE="hardened pie static" emerge -av xorg-x11


IIRC, Static just compiles all modules into the binary, right? That would solve any module loading problems, wouldn't it? :D


That's my understanding, modules and libraries are statically linked. Increases the binaries size, but there isn't much choice in this instance. :D
Back to top
View user's profile Send private message
kevquinn
Retired Dev
Retired Dev


Joined: 27 Jun 2003
Posts: 52

PostPosted: Tue Jul 27, 2004 5:49 am    Post subject: Reply with quote

Just an update; I emerged xorg-x11 r2 last night; so tried a slight variation. Built gcc with just USE="-hardened" emerge gcc, then built xorg-x11 straight (and then rebuilt gcc) - I don't think xorg-x11 looks at hardened, pic or pie. So there's no point messing with pic and pie flags. There's a new use flag, dlloader, which might be related - but it's undocumented, as is sdk.

The reason for rebuilding gcc, is that hardened gcc has pie et. al. switched on by default, which the xorg-x11 build is no doubt assuming is off by default. There must be some low-level code in there somewhere that violates the hardened gcc constraints - but that's a lot of code to search! Had a related issue with Wine from cvs, however that failed to compile at the relevant file, which made it easy to find what to fix (preloader.c, if anyone's interested - hacked the makefile for the loader to use -fno-stack-protector -fno-pic -fno-pie on preloader.c only). xorg-x11 doesn't fail to compile.
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Sat Aug 14, 2004 6:13 pm    Post subject: Dlloader Reply with quote

My nvidia card (geforce 2 and in the meantime upgraded to an fx5500) stopped working with the "nvidia" drivers (but works with the "nv" drivers) when I recompiled xorg with the static flag due to the hardened issue.

I'm in the process of recompiling xorg-r1 with the dlloader flag, which I suppose may be the problem. It means "DynamicLibraryLoader" if I'm not mistaken. The "nvidia" module for glx purposes needs to be loaded, that is why this hypothesis.

If anyone has more info, let us know. I'll post back once I get xorg recompiled.

Best regards,
Back to top
View user's profile Send private message
seaq
n00b
n00b


Joined: 15 Jun 2003
Posts: 20
Location: Colombia

PostPosted: Sun Aug 15, 2004 7:54 pm    Post subject: same problem Reply with quote

i've got a question , the static flag would make the xorg server slower?

i'll wait for the results of dlloader recompilation to give it a try
Back to top
View user's profile Send private message
spudicus
Apprentice
Apprentice


Joined: 05 Dec 2002
Posts: 177
Location: Geraldton, Australia

PostPosted: Mon Aug 16, 2004 1:07 am    Post subject: Reply with quote

I've since re-emerged xorg with USE="dlloader hardened pic pie" flags (no static).

EDIT: ati-drivers currently don't load, possibly due to "pie" flag.
Back to top
View user's profile Send private message
kevquinn
Retired Dev
Retired Dev


Joined: 27 Jun 2003
Posts: 52

PostPosted: Tue Aug 17, 2004 12:47 pm    Post subject: Issue should be resolved soon. Reply with quote

There's been some progress - see https://bugs.gentoo.org/show_bug.cgi?id=43177 - the problem building xorg with hardened gcc should be resolved soon (at least worked around avoiding rebuilding gcc!).

I think the ati-drivers will not need changing; they work fine for me, with xorg hacked to build sensibly with hardened gcc.
Back to top
View user's profile Send private message
spudicus
Apprentice
Apprentice


Joined: 05 Dec 2002
Posts: 177
Location: Geraldton, Australia

PostPosted: Tue Aug 17, 2004 1:48 pm    Post subject: Reply with quote

Hhhmmm :evil:

Just when I recompile GCC without hardened/pie/pic and recompile xorg, a fix is in the works :( :p :)
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Fri Aug 27, 2004 2:02 pm    Post subject: Reply with quote

Sorry about the delay, I went on vacation and didn't find the time (and computer resources) to reply.

When I recompiled xorg with dlloader, nothing changed regarding nvidia. I still cannot use the nvidia drivers, just nv.

I suppose I'll recompile gcc without hardened for the time being.
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Thu Sep 02, 2004 1:11 am    Post subject: Reply with quote

I wonder if everyone here experiencing this issue is using the hardened profile, If they are in the default profile as opposed to hardened the X use flag is set, so in the hardened profile X is not passed to gcc durring the bootstrap.

Just a thought i have not tried building gcc with X in my USE statement but i am also experiencing the same issues as described in this thread.
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
kevquinn
Retired Dev
Retired Dev


Joined: 27 Jun 2003
Posts: 52

PostPosted: Thu Sep 02, 2004 6:25 am    Post subject: Reply with quote

While not everyone is using the hardened profile as such, I think everyone with this issue has gcc compiled with the hardened use flag. It's the default enabling of -fstack-protector and -fpie in gcc (an effect of setting the hardened use flag when building gcc) which trigger the problem. Possibly the same problem occurs for people not using hardened gcc but who have -fstack-protector in the CFLAGS.
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Sun Sep 05, 2004 4:48 am    Post subject: Reply with quote

After talking to some of the hardened developers using static works for the x86 version of xorg-x11 as with xfree.

In the masked versions of xorg-x11 witch will become 6.8.0 passing dlloader will work and 6.8 will become the standard on the hardened profile when it is released.

Or so i was told!
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
spudicus
Apprentice
Apprentice


Joined: 05 Dec 2002
Posts: 177
Location: Geraldton, Australia

PostPosted: Mon Sep 06, 2004 1:21 am    Post subject: Reply with quote

Snooper wrote:
In the masked versions of xorg-x11 which will become 6.8.0 passing dlloader will work and 6.8 will become the standard on the hardened profile when it is released.

Until 6.8, static is no good for Nvidia or Ati drivers. You have to use the builtin drivers instead if static set. Currently there are issues with Ati and the dlloader flag (at least in a hardened profile), so a hardened xorg isn't always viable.

OTOH: Is it really necessary to compile gcc with the hardened flags at all, wouldn't it be easier to instead pass the CFLAGS directly that hardened gcc defaults to, and when something doesn't work you just need to comment out the relevant CFLAG instead of recompiling gcc? Or does hardened gcc add more than enforcing -fstack-protector-all, -fpic and -fpie flags?
Back to top
View user's profile Send private message
coren2000
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2003
Posts: 75
Location: Toronto Canada

PostPosted: Tue Sep 07, 2004 3:30 am    Post subject: static and hardened Reply with quote

Static is no good for any modules you want to load in X.
Back to top
View user's profile Send private message
drbugs
n00b
n00b


Joined: 23 Mar 2004
Posts: 8
Location: Shakopee, MN, USA

PostPosted: Fri Sep 10, 2004 1:26 pm    Post subject: Failure with 6.8 Reply with quote

I tried the upgrade to 6.8.0 last night, no joy with the -hardened/hardened gcc. It compiles fine, but when I try to do an Xorg -configure, it fails with somethiing like "duplicate symbol" in a font file (I'm at work and don't have an exact copy of the error).

Anyone else have a better story?
Back to top
View user's profile Send private message
drbugs
n00b
n00b


Joined: 23 Mar 2004
Posts: 8
Location: Shakopee, MN, USA

PostPosted: Sun Sep 12, 2004 8:39 pm    Post subject: Re: Failure with 6.8 Reply with quote

drbugs wrote:
I tried the upgrade to 6.8.0 last night, no joy with the -hardened/hardened gcc. It compiles fine, but when I try to do an Xorg -configure, it fails with somethiing like "duplicate symbol" in a font file (I'm at work and don't have an exact copy of the error).

Anyone else have a better story?


I applied the patch that is referred to earlier in this thread, and it works so far on 6.8.0. Looks like I don't have accelerated 3d, but I am using this box as a server and just wanted a couple of "nice to have" kapps for the rare time I am running X.
Back to top
View user's profile Send private message
kevquinn
Retired Dev
Retired Dev


Joined: 27 Jun 2003
Posts: 52

PostPosted: Fri Sep 17, 2004 6:39 am    Post subject: Reply with quote

FI, I've uploaded a new patch to https://bugs.gentoo.org/show_bug.cgi?id=43177 which only removes pie for modules - the stack protector now builds in 6.8.0 without causing any problems.
Back to top
View user's profile Send private message
tcbounce
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2003
Posts: 86
Location: South Korea

PostPosted: Mon Sep 27, 2004 6:30 am    Post subject: xorg-x11 mixed success / failure with dllloader Reply with quote

Last night I recompiled X with the patch mentioned above. I found out that the source code patch was added already to the xorg-x11-6.8.0-r1 build file.

I am getting interesting results here. I have successfully got the package to run on my main system that compiled the program last night using -fstack-protector and it only reports a few error messages about GLX and unresolved symbols. I am using a i740 on that system so I will report to the bugs list that the patch is successfully tested on that hardware.

The problem I am having however is on a different system. When I merge the binary package created on the first system, I am getting much more errors relating to unresolved symbols as per this bug report!!

What dependancies does the dll loader have. I will reinstall my binuitls and glibc and update you on it later. Any tips would be appreciated.

[ update solved ]
I just copied over the /usr/X11R6/lib/modules directory to the problematic host using tar, and it fixed the problem. Why isn't quickpkg copying these files over when it make an .tgz file????


Cheers,

Luke


Last edited by tcbounce on Mon Sep 27, 2004 8:34 am; edited 1 time in total
Back to top
View user's profile Send private message
tcbounce
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2003
Posts: 86
Location: South Korea

PostPosted: Mon Sep 27, 2004 7:54 am    Post subject: still no luck Reply with quote

I tried a quickpkg glibc binutils xorg-x11 and installed the same packages on the problematic host, only to get the same problem.

I had some problems loading security policies so I copied over the config from my main server and still couldn't load. I rebooted the system and that fixed it. Now i'm doing an emerge -ke system to make the two systems identical.

How can one system have the unresolved symbols and the other not when they both have the same xorg-x11 package I don't know. I'll compile again locally on the problematic host it still has unresolved symbols.
Back to top
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Sun May 01, 2005 4:59 pm    Post subject: Reply with quote

Moved to Duplicate Threads, please see USE=hardened breaks XOrg server for more information and direct any followups there, too.
_________________
Dinosaur week! (Ok, this thread is so last week)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum