Bug 752525 - support for gcc -m32 not possible on x86_64 (gcc.i686 and gcc.x86_64 can't be coinstalled)
Summary: support for gcc -m32 not possible on x86_64 (gcc.i686 and gcc.x86_64 can't be...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 16
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-09 18:55 UTC by Alon Levy
Modified: 2014-08-04 22:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-09 19:08:31 UTC
Type: ---


Attachments (Terms of Use)

Description Alon Levy 2011-11-09 18:55:16 UTC
Description of problem:
I have a x86_64 fedora 16 install and want to have a working gcc -m32, including compilation and linkage. To do that I try to install gcc.i686 while already having gcc.x86_64 installed. I got a transaction error because of a single point of conflict:

%{_prefix}/libexec/getconf/default is shared by both packages.

1. Is there another way to get gcc -m32 -o test test.c functional? (test.c is int main() { return 0; })?

I've tried to install gcc.i686 because yum provides "*gcc_s.so" showed only gcc.i686, before that stubs-32.h led me to install glibc-devel.i686, which did succeed (I have glibc-devel.x86_64 installed as well).

Version-Release number of selected component (if applicable):
gcc-4.6.2-1.fc16.x86_64
gcc-4.6.2-1.fc16.i686

How reproducible:
100%

Steps to Reproduce:
1. start with a F16 x86_64 install.
2. yum install gcc -y
3. add fedora32.repo, same as /etc/yum.repos.d/fedora.repo, just using arch=i386 (and renaming the sections to avoid name conflict)
4. yum install gcc.i686 -y
  
Actual results:
(the output is larger on initial install, I installed all the gcc prerequisites that were not conflicting before)

x86_64 garlic:gcc alon (f16)$ sudo yum install gcc.i686 -y
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.i686 0:4.6.2-1.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================
 Package                               Arch                                   Version                                        Repository                                  Size
==============================================================================================================================================================================
Installing:
 gcc                                   i686                                   4.6.2-1.fc16                                   fedora32                                    11 M

Transaction Summary
==============================================================================================================================================================================
Install       1 Package

Total size: 11 M
Installed size: 11 M
Downloading Packages:
Running Transaction Check
Running Transaction Test


Transaction Check Error:
  file /usr/libexec/getconf/default from install of gcc-4.6.2-1.fc16.i686 conflicts with file from package gcc-4.6.2-1.fc16.x86_64

Error Summary
-------------


Expected results:
successful installation. gcc -m32 working.

Additional info:

I'm currently building a new local gcc package based on the following patch, it is simplistic - it doesn't take care of packaging the /usr/libexec/getconf/default file, but maybe something along these lines could work?

commit 8ed2de3de1cf834a73d5443a87fe247c2a71e9aa
Author: Alon Levy <alevy>
Date:   Wed Nov 9 19:42:34 2011 +0200

    pirate copy without %{_prefix}/libexec/getconf/default to avoid conflict of gcc.x86_64 and gcc.i686

diff --git a/gcc.spec b/gcc.spec
index f2b9d4f..b636b6b 100644
--- a/gcc.spec
+++ b/gcc.spec
@@ -3,7 +3,7 @@
 %global gcc_version 4.6.2
 # Note, gcc_release must be integer, if you want to add suffixes to
 # %{release}, append them after %{gcc_release} on Release: line.
-%global gcc_release 1
+%global gcc_release 1.alon
 %global _unpackaged_files_terminate_build 0
 %global multilib_64_archs sparc64 ppc64 s390x x86_64
 %ifarch %{ix86} x86_64 ia64 ppc ppc64 alpha
@@ -1169,11 +1169,6 @@ rm -f $FULLPATH/adalib/libgnarl.so* $FULLPATH/adalib/libgnat.so*
 %endif
 
 mkdir -p %{buildroot}%{_prefix}/libexec/getconf
-if gcc/xgcc -B gcc/ -E -dD -xc /dev/null | grep __LONG_MAX__.*2147483647; then
-  ln -sf POSIX_V6_ILP32_OFF32 %{buildroot}%{_prefix}/libexec/getconf/default
-else
-  ln -sf POSIX_V6_LP64_OFF64 %{buildroot}%{_prefix}/libexec/getconf/default
-fi
 
 %if %{build_java}
 pushd ../fastjar-%{fastjar_ver}/obj-%{gcc_target_platform}
@@ -1870,7 +1865,6 @@ fi
 %endif
 %endif
 %dir %{_prefix}/libexec/getconf
-%{_prefix}/libexec/getconf/default
 %doc gcc/README* rpm.doc/changelogs/gcc/ChangeLog* gcc/COPYING* COPYING.RUNTIME
 
 %files -n cpp -f cpplib.lang

Comment 1 Jakub Jelinek 2011-11-09 19:08:31 UTC
Trying to install both gcc.x86_64 and gcc.i686 is a user error, don't do that.
If you want gcc -m32 working, all you need to do is
yum install gcc gcc-c++
yum install {glibc{,-devel},lib{gcc,stdc++{,-devel}}}.i686

Comment 2 Alon Levy 2011-11-09 21:09:46 UTC
Thanks, sorry for opening a bug for this. I made a mistake looking for libgcc_s.so, didn't notice usr/lib/gcc/x86_64-redhat-linux/4.6.2/32/libgcc_s.so. Thanks very much for the quick response!

Alon


Note You need to log in before you can comment on or make changes to this bug.