Thanks for the pointers. I tried this on servers running Ubuntu Hardy
and Jaunty, but I'm still getting the errors and Passenger won't load
my Rails app. Does anybody have any further suggestions?
> Well, the problem is that REE and passenger overrule some user-set CFLAGS.
> Just for certain parts I think.
> Also, if you install gems later on, with native extensions, the flags
> won't be used (at least for some gems).
> This isn't a real problem (gets the 4gb warnings down from thousands
> to just a couple of 10s), which really won't be noticable
> performance-wise.
> The only thing that completely removed all warnings was to wrap gcc and g++.
> Problem with that, is that compiling stuff becomes a lot slower.
> Since you only do that once (not during normal operation), this might
> be ok for you.
> mv /usr/bin/gcc /usr/bin/gcc.orig
> mv /usr/bin/g++ /usr/bin/g++.orig
> echo '#!/bin/sh' > /usr/bin/gcc
> echo '#!/bin/sh' > /usr/bin/g++
> echo 'exec gcc.orig -mno-tls-direct-seg-refs $@' >> /usr/bin/gcc
> echo 'exec g++.orig -mno-tls-direct-seg-refs $@' >> /usr/bin/g++
> chmod a+x /usr/bin/gcc
> chmod a+x /usr/bin/g++
> This forces gcc to always apply the flag, even if some makefile
> overrules CFLAGS.
> After doing this, my g4b warnings completely vanished.
> You will probably have to watch out with gcc upgrades, so maybe move
> stuff back after installing all REE/passenger/gem stuff.
> Mathijs
> On Thu, Sep 10, 2009 at 1:32 AM, chipcastle <supp...@chipcastle.com> wrote:
> > I'm not sure what fix is the proper one. Here's what I've tried on
> > Ubuntu Hardy AND Jaunty to no avail:
> > 1. Added to /etc/environment:
> > export CFLAGS="-mno-tls-direct-seg-refs"
> > export CXXFLAGS="-mno-tls-direct-seg-refs"
> > sudo reboot
> > 2. Installed passenger from source, editing Rakefile:
> > EXTRA_CXXFLAGS = "-Wall #{OPTIMIZATION_FLAGS} -mno-tls-direct-seg-
> > refs"
> > sudo /etc/init.d/apache2 restart
> > 3. Installed passenger as a gem:
> > sudo gem uninstall passenger
> > sudo gem install passenger --no-rdoc --no-ri
> > sudo passenger-install-apache2-module
> > sudo /etc/init.d/apache2 restart
> > 4. (on Hardy only) Installed from passenger made available by
> > Brightbox:
> > sudo sh -c 'echo "debhttp://apt.brightbox.nethardy main" > /etc/apt/
> > sources.list.d/brightbox.list'
> > sudo sh -c 'wget -q -O -http://apt.brightbox.net/release.asc| apt-
> > key add -'
> > sudo apt-get update
> > sudo apt-get install libapache2-mod-passenger
> > # Edit /etc/apache2/apache2.conf to comment out the following:
> > # Include /etc/apache2/extras/passenger.conf
> > sudo a2enmod passenger
> > sudo /etc/init.d/apache2 restart
> > 5. Moved tls directory
> > sudo mv /lib/tls /lib/tls.disabled
> > Here's what I have on my amazon ec2 running ubuntu jaunty (ami id: ami-
> > ed46a784)
> > cat /etc/lsb-release
> > DISTRIB_ID=Ubuntu
> > DISTRIB_RELEASE=9.04
> > DISTRIB_CODENAME=jaunty
> > DISTRIB_DESCRIPTION="Ubuntu 9.04"
> > echo $PATH
> > /usr/local/ruby-enterprise/bin:/usr/local/sbin:/usr/local/bin:/usr/
> > sbin:/usr/bin:/sbin:/bin:/usr/games
> > cat /etc/ld.so.conf.d/libc6-xen.conf
> > hwcap 0 nosegneg
> > ldd /usr/local/ruby-enterprise/bin/ruby
> > linux-gate.so.1 => (0x005ec000)
> > libtcmalloc_minimal.so.0 => /usr/local/ruby-enterprise/lib/
> > libtcmalloc_minimal.so.0 (0x00225000)
> > libdl.so.2 => /lib/libdl.so.2 (0x00691000)
> > libcrypt.so.1 => /lib/libcrypt.so.1 (0x001b5000)
> > libm.so.6 => /lib/libm.so.6 (0x00ddf000)
> > libc.so.6 => /lib/libc.so.6 (0x007a9000)
> > libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00f0b000)
> > libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00110000)
> > /lib/ld-linux.so.2 (0x00c27000)
> > cat /etc/apache2/extras/passenger.conf
> > LoadModule passenger_module /usr/local/ruby-enterprise/lib/ruby/gems/
> > 1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so
> > PassengerRoot /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/
> > passenger-2.2.5
> > PassengerRuby /usr/local/ruby-enterprise/bin/ruby
> > Is there a step I am missing?
> > Any help is greatly appreciated,
> > Chip
> > On Jul 24, 5:29 pm, Steven Pokrandt <spo...@gmail.com> wrote:
> >> I've applied the fix suggested in this thread and the errors stopped..