Bug 60218

Summary: gcc-3.1-0.21 : broken symlink when %{_prefix} is long.
Product: [Retired] Red Hat Raw Hide Reporter: Sergey Ostrovsky <sostrovsky>
Component: gcc3Assignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-04 23:04:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sergey Ostrovsky 2002-02-22 12:03:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.5+) Gecko/20011103

Description of problem:
These are actually comments to the patch in "steps to reproduce"...
1) Some people use Red Hat components on their own systems,
   so using %{_vendor} where appropriate would be useful,
   while on Red Hat system %{_vendor}==redhat automagically ...
2) When %{_prefix} path has more than one dir node
   ( like /usr/local ), that relative symlink will be broken.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
--- gcc31.spec.orig     Tue Feb  5 06:51:46 2002
+++ gcc31.spec  Fri Feb 22 06:05:43 2002
@@ -275,8 +275,8 @@
 TARGET_PLATFORM=%{_target_platform}

 # There are some MP bugs in libstdc++ and libjava Makefiles
-make -C *-redhat-linux/libstdc++-v3
-make -C *-redhat-linux/libjava
+make -C *-%{_vendor}-linux/libstdc++-v3
+make -C *-%{_vendor}-linux/libjava

 make prefix=$RPM_BUILD_ROOT%{_prefix} mandir=$RPM_BUILD_ROOT%{_mandir} \
   infodir=$RPM_BUILD_ROOT%{_infodir} install
@@ -307,7 +307,7 @@
 mv -f $RPM_BUILD_ROOT%{_prefix}/lib/libgcc_s.so.1
$RPM_BUILD_ROOT/%{_lib}/libgcc_s-%{gcc_version}-%{DATE}.so.1
 chmod 755 $RPM_BUILD_ROOT/%{_lib}/libgcc_s-%{gcc_version}-%{DATE}.so.1
 ln -sf libgcc_s-%{gcc_version}-%{DATE}.so.1 $RPM_BUILD_ROOT/%{_lib}/libgcc_s.so.1
-ln -sf ../../%{_lib}/libgcc_s.so.1 $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libgcc_s.so
+ln -sf $( echo "%{_prefix}" | %{__sed} 's/[\/][^\/]*/\.\.\//g'
)../%{_lib}/libgcc_s.so.1 $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libgcc_s.so
 mv -f $FULLPATH/libobjc.so.1* $RPM_BUILD_ROOT%{_prefix}/%{_lib}/
 pushd $FULLPATH
 if [ "%{_lib}" = "lib" ]; then


Additional info:

Comment 1 Jakub Jelinek 2004-10-04 23:04:13 UTC
Current gcc{32,33,34,4a}.spec uses absolute, not relative symlink
for libgcc_s.so.