building ports with gcc46 under 8-STABLE (for the fun)

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

building ports with gcc46 under 8-STABLE (for the fun)

Postby tobe » 13 Aug 2011, 10:03

Hello,

I have to stay home today just in case my employer calls me for assistance, so i decided to mess around with FreeBSD ports on my laptop :)

I've installed gcc46 (as described in the handbook, but for gcc44) and tried to recompile all ports.

I known this is not a good idea, but remember i'm just playing with my computer to kill time and probably most of the softwares i've installed so far.

I got some problems with the stack protector flag (now enabled by default), lots of ports failed to build with the following error :

Code: Select all
undefined reference to `__stack_chk_fail_local'


So i decided to remove it (...) by adding the line "SSP_CFLAGS=" in [FILE]/etc/make.conf[/FILE], only for ports.

Seems like it's building fine now, but i have a couple of questions :

Is this a known problem ?
Is SSP_CFLAGS= the "right way", if any, to disable stack protection ?
Or, is there any way to keep stack protection and build with gcc46 ?
[color="Gray"]1: Introduce bug; 2: Fix bug; 3: Goto 1[/color]
User avatar
tobe
Junior Member
 
Posts: 92
Joined: 23 Jan 2009, 12:39
Location: Europe.France.Lyon

Postby poh-poh » 13 Aug 2011, 10:46

Try to place gcc46 libs before basegcc libs in [man=1]rtld[/man] hints which also affect [man=1]ld[/man] that's likely link against wrong libssp (another example is [pr]ports/148196[/pr]), e.g.
Code: Select all
Index: etc/rc.d/ldconfig
===================================================================
--- etc/rc.d/ldconfig   (revision 224789)
+++ etc/rc.d/ldconfig   (working copy)
@@ -22,7 +22,7 @@
    ldconfig=${ldconfig_command}
    checkyesno ldconfig_insecure && _ins="-i"
    if [ -x "${ldconfig_command}" ]; then
-      _LDC="/lib /usr/lib"
+      _LDC="/usr/local/lib/gcc46 /lib /usr/lib"
       for i in ${ldconfig_local_dirs}; do
          if [ -d "${i}" ]; then
             _files=`find ${i} -type f`
User avatar
poh-poh
Junior Member
 
Posts: 39
Joined: 09 Apr 2011, 18:57

Postby tobe » 13 Aug 2011, 12:09

Thanks for the suggestion, and for pointing me the PR, but i'd prefer something i could configure conditionally like it's done in [FILE]/etc/make.conf[/FILE].

I'll take a look at the -rpath option later, i'm now rebuilding all ports and i don't want to stop it right now :)
[color="Gray"]1: Introduce bug; 2: Fix bug; 3: Goto 1[/color]
User avatar
tobe
Junior Member
 
Posts: 92
Joined: 23 Jan 2009, 12:39
Location: Europe.France.Lyon


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: No registered users and 4 guests