LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-23-2008, 03:59 AM   #1
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Rep: Reputation: 0
Patch Slackware 12.1 with existing RH patch


Background :
Am trying to build a Slackware Server box similar to a RedHat server.
Some of the basic C application types compile and execute fine.

However for some type of application that have more dependencies, bumped
into an issue that is likely fixed on RH. The error is as below :

=========================================================================
/usr/lib/gcc/i486-slackware-linux/4.2.3/../../../../i486-slackware-linux/bin/ld: errno@@GLIBC_PRIVATE: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS definition in MMMM.so section .bss
MMMM.so: could not read symbols: Bad value
collect2: ld returned 1 exit status
=========================================================================

Googled to find that changing
extern int errno;
to
#include <errno.h>
should resolve the issue.

This is not a solution, since i wouldn't like to change MMMM.so

Further google searches led me to RH fix at :
http://www.sourceware.org/ml/binutil.../msg00299.html and
http://sources.redhat.com/bugzilla/show_bug.cgi?id=414

To confirm that this wasn't an issue on the RH box, was able to compile
the bug.c(link #2 above) as is on RH server as against Slackware.

Have downloaded sources for Slackware 12.1. Will install these.
Would like to have this patch on my Slackware box.

My queries are as below :

Which components need to be patched/rebuilt based on this ?
Would just building/upgrading gcc or whatelse be enough ?

Any links to detailed procedure for same would help ?

Else with 12.2 already out. Can anyone tell if this is fixed in 12.2.
have set this up recently, might just decide to upgrade to 12.2

Thanks for your help and advice.

Last edited by dsmatharu; 12-23-2008 at 04:31 AM. Reason: Clarity
 
Old 12-23-2008, 05:57 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
That patch is meant to be applied to binutils. binutils is easy to re-compile, but you may want to re-compile the rest of the toolchain also which is not so simple. Use the SalckBuild scripts from official Slackware, bump the BUILD number for each: re-compile binutils, then gcc, then glibc then gcc again, installing(using upgradepkg) each package as you go.
Lots luck and make sure you know how to re-cover from a non-bootable machine by re-installing the original binutils, gcc and glibc if things go wrong...

A better bet might be to report the bug to PatV and see if he thinks it should be fixed. That's a pretty old patch, so I wonder of it has already been fixed upstream. You could check the sources for binutils and see if the fix is already in there.
 
Old 12-23-2008, 09:20 AM   #3
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks gnashley,

Had been deterred by the required toolchain build sequence.

Compared the sources, it seems the patch is there in 12.1 already.
Not really sure here though. Some expert view/advice is required.

For me real test would be to have the bug.c below compile successfully
on Slackware 12.2 (i86 platform).

$ cat bug.c
extern int errno;

int main ()
{
printf("errno = %d\n",errno);
return 0;
}

A successfull compile/link with :
$ gcc tls-bug.c -L/usr/lib/nptl


Hopefully someone with a Slackware 12.2 can help me out with this test.
Else i might just upgrade in "goodfaith" and hope for best !!!

Regards,
 
Old 12-23-2008, 10:22 AM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
Hopefully someone with a Slackware 12.2 can help me out with this test.
Else i might just upgrade in "goodfaith" and hope for best !!!
The little program you supplied (bug.c) won't compile on Slackware 12.2 - it gives the TLS errors - unless you either 1) Change the line :
Code:
extern int errno;
to be :
Code:
#include <errno.h>
or compile it with :
Code:
gcc bug.c -include errno.h -L/usr/lib/nptl
Hope this helps
 
Old 12-24-2008, 12:05 AM   #5
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks Eddy, for having done the test for me.

Now i know upgrade to 12.2 is off for now.
Whether to do a toolchain upgrade or maybe change of distro.

As indicated in first post, i have a reference RH box.
So this is almost a blocker, or too much effort to patch ???

Will take some time to decide !!!

Regards,
 
Old 12-25-2008, 02:16 AM   #6
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Latest Update !!!

Had a more detailed look and some thoughts, and have the following.

- Part of patch ( /* Check TLS symbol. */ .. if ) is not on 12.1 or 12.2
- Unable to install RH7.1 due to HDD compat issue. ( not stated earlier )

Course of action is :
Ask/Try for another still older box that will take RH7.1 - Tough Luck.
Install latest RH, shouldn't have problem with HDD & this TLS issue.
Patch Slackware .... upgrade toolchain .... I am getting ready !!!

Regards,
 
Old 12-25-2008, 05:28 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I would try patching and recompiling the binutils on Slackware and see if that fixes the problem. You can use the official SlackBuild, at least as a guide.
 
Old 12-25-2008, 11:47 PM   #8
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Treading the path ...

Hello gnashley,

Started on the binutils patch. Have a few elementary questions as well.
As suggested started with the SlackBuild for binutils-2.17.50.0.17

Patched the source file, and retained VERSION as 2.17.50.0.17
Ran the commands from SlackBuild step by step till "make -j6" and
"make info".

Some Questions :
1) Is the VERSION as is above and BUILD=1 good enough to bump the BUILD.
Edit : Changed BUILD to 2 ... to be able to differentiate ...
In addition where should a comment be placed about the patch applied.

2) Beyond "make -j6" the following snippets from SlackBuild concerns me.
==========================================================================
make -j6 || exit 1
make info || exit 1
# Needed to link ksymoops:
make install || exit 1
# We need to clear ldscripts/ because binutils doesn't implement DESTDIR everywhere:
rm -rf /usr/lib/ldscripts /usr/${ARCH}-slackware-linux/lib/ldscripts
# Repopulate it:
make install || exit 1
# Install into the $PKG location:
make install DESTDIR=$PKG || exit 1
# Add fresh ldscripts:
cp -a /usr/${ARCH}-slackware-linux/lib/ldscripts $PKG/usr/lib

==========================================================================

Would the rm -rf /usr/lib/ldscripts ..... make my system go boom !!!
Do i need a single user mode for this step ?
Will need it for upgradepkg for sure.
Would the "make install" install in /usr as configure --prefix=/usr
Have a few users using the machine, so would like to tread carefully.

3) Towards end of SlackBuild also see :
#############################
oprofile links to libbfd so
be sure to recompile that
#############################
How crucial is that for the usual code/compile/link/run/test cycle ?

Before ending i would say would like to stick to Slackware since i don't
like rpms somehow and would prefer learning classic Linux than a distro.

Thanks & Regards,

Last edited by dsmatharu; 12-26-2008 at 01:55 AM.
 
Old 12-26-2008, 02:12 AM   #9
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Yes, just bumping the BUILD number will make upgradepkg handle the new package correctly.
Removing the ldscripts and really installing the neew binutils (make install) won't make your system go boom. If some user is in the process of compiling something, they may get a surprise. I've been building binutils lately, and I found that the "real" 'make install' was unneeded, that is using make DESTDIR=$PKG install worked fine and did install the ldscripts into DESTDIR, so removing the real copies, installing the new ones and copying them from the real root was not needed.

It shouldnn't be too big a deal to re-compile oprofile if you even use that or have it installed. If not, don'T worsyy about it.

binutils is not a system-critical package, so you can upgrade it just fine from a normal runlevel of 3 or 4. There is no need to go into maintenance mode. As far as having other users logged in, that is also no problem -only if a user is compiling/linking something at the moment you upgrade, then they may have a surprise. But even so, I doubt it, because of the way upgradepkg works -it simply overwrites the existing program with the new one on-the-fly, so your system is never without the program at any time.
 
Old 12-26-2008, 03:09 AM   #10
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks gnashley,

Was able to proceed and build the package. By passed the "real make" and related stuff.

Built package, and upgraded. However, this has not resolved issue with bug.c yet.

Regards,
 
Old 12-26-2008, 10:26 AM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You may have to do the same thing with glibc itself by re-compiling it also. But be sure your system is idle when you upgrade glibc. You need to be in runlevel 1 to do that.

Last edited by gnashley; 12-26-2008 at 11:56 AM.
 
Old 12-29-2008, 08:03 AM   #12
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Recompiled and upgraded glibc.
However TLS issue remains.
Wondering if have been going the wrong alley !!!

Could it be that configure options (of glibc etc for RH & Slack) are different. Need to get another handle it seems.

Thanks, learnt quite a lot anyways.

Edit :
In addition the -L/usr/lib/nptl flag is inconsequential.

Last edited by dsmatharu; 12-29-2008 at 08:47 AM.
 
Old 12-29-2008, 09:42 AM   #13
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Try locating the srpm for the RHG glibc sources and look in the spec file to see which options were used to compile it.
 
Old 12-30-2008, 12:14 AM   #14
dsmatharu
LQ Newbie
 
Registered: Dec 2008
Location: Pune, India
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: 0
Finally some light !!!

Found the right patch for sure !!!

http://sources.redhat.com/ml/libc-al.../msg00016.html
( the earlier one was for linker crash )

Not available in Slackware source.
Also patch in conformance with the known fix for errno TLS issue.

Plan to do the following now :-

Undo the binutils/glibc fix.
Apply this patch for glibc.

Regards,
 
Old 12-30-2008, 01:01 AM   #15
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
If you properly bumped the BUILD number for ninutils, you can just use upgradepkg to re-install the original package -upgradepkg works the same to downgrade as to upgrade. And for glibc, just bumpt the BUILD number again for the rebuild.
 
  


Reply

Tags
mismatch, patch, redhat, slackware12, tls



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to patch my redhat Enterprise Linux 5.1 to the latest patch level? shaybery Red Hat 4 10-05-2008 02:04 AM
Can I patch my existing kernel? javedmk80 Linux - Networking 9 09-24-2007 05:09 AM
How to Install patch-o-matic(a iptables patch) on redhat 9? itebooks Linux - Security 1 07-23-2004 08:51 AM
debian-patch-debianlogo w/2.6.5 kernel-patch-lpp Outabux Debian 11 05-20-2004 01:21 PM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration