I noticed that combining -m32 and -m64 has different effects on different
platforms.

On sparc64:
20:06 ares:../libhugetlbfs/libhugetlbfs-2.0 > gcc -c -m32 -m64 x.c
gcc: may not use both -m32 and -m64

On x86_64:
20:11 borg:~/obs > >x.c
20:11 borg:~/obs > gcc -c -m32 -m64 x.c
(no error)

I think that this behavior should be unified across gcc's supported arches, and
I would opt for not allowing both -m32 and -m64, to detect flawed packages
(like libhugetlbfs in this case) that manually add -m64 - perhaps even in the
wrong place - based upon their arch detection heuristic (which is generally not
accurate).

The particular example point in case is rpmbuilding on SUSE where RPM_OPT_FLAGS
carries -m32 (this is correct) and libhugetlbfs's Makefile statically adds -m64
(this is incorrect). This error has not popped up earlier since combining -m32
and -m64 is unfortunately permitted on x86.


-- 
           Summary: Status of using both -m32 and -m64 on the same command
                    line
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jengelh at medozas dot de
 GCC build triplet: sparc64-suse-linux-gnu
  GCC host triplet: sparc64-suse-linux-gnu
GCC target triplet: sparc64-suse-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42994

Reply via email to