public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
@ 2003-04-04 13:06 Nick Clifton
0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2003-04-04 13:06 UTC (permalink / raw)
To: jakub; +Cc: gcc-prs
The following reply was made to PR target/8022; it has been noted by GNATS.
From: Nick Clifton <nickc@redhat.com>
To: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Cc: hyc@symas.com, jsurveyor@macquarie.net.au, gcc-patches@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Subject: Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
Date: 04 Apr 2003 13:59:49 +0100
Hi Rainer,
> This cannot be right: only gas understands the -TSO flag (is this
> true for all versions currently claimed to be supported on Solaris
> 2?), the native as certainly does not. I suppose this belongs to
> sol2-gas-bi.h.
Doh! Yes of course. Fixed as follows.
Cheers
Nick
2003-04-04 Nick Clifton <nickc@redhat.com>
* config/sparc/sol2-bi.h: Revert previous delta.
* config/sparc/sol2-gas-bi.h (AS_SPARC64_FLAG): Prepend -TSO
Index: gcc/config/sparc/sol2-bi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-bi.h,v
retrieving revision 1.9
diff -c -3 -p -w -r1.9 sol2-bi.h
*** gcc/config/sparc/sol2-bi.h 3 Apr 2003 10:21:22 -0000 1.9
--- gcc/config/sparc/sol2-bi.h 4 Apr 2003 12:56:42 -0000
***************
*** 10,16 ****
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC ""
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG " -TSO"
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
#undef CPP_CPU64_DEFAULT_SPEC
--- 10,16 ----
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC ""
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
#undef CPP_CPU64_DEFAULT_SPEC
***************
*** 24,38 ****
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a -TSO"
#endif
#if DEFAULT_ARCH32_P
#define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{m64:" __str " -TSO}"
#else
#define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str " -TSO}"
#endif
#undef CPP_CPU_SPEC
--- 24,38 ----
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a"
#endif
#if DEFAULT_ARCH32_P
#define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
#else
#define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
#endif
#undef CPP_CPU_SPEC
Index: gcc/config/sparc/sol2-gas-bi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-gas-bi.h,v
retrieving revision 1.2
diff -c -3 -p -w -r1.2 sol2-gas-bi.h
*** gcc/config/sparc/sol2-gas-bi.h 17 Apr 2002 01:37:42 -0000 1.2
--- gcc/config/sparc/sol2-gas-bi.h 4 Apr 2003 12:56:42 -0000
***************
*** 2,5 ****
running Solaris 2 using the GNU assembler. */
#undef AS_SPARC64_FLAG
! #define AS_SPARC64_FLAG "-64 -Av9"
--- 2,5 ----
running Solaris 2 using the GNU assembler. */
#undef AS_SPARC64_FLAG
! #define AS_SPARC64_FLAG "-TSO -64 -Av9"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
@ 2003-04-03 16:26 Kaveh R. Ghazi
0 siblings, 0 replies; 5+ messages in thread
From: Kaveh R. Ghazi @ 2003-04-03 16:26 UTC (permalink / raw)
To: jakub; +Cc: gcc-prs
The following reply was made to PR target/8022; it has been noted by GNATS.
From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
To: ro@TechFak.Uni-Bielefeld.DE
Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org, hyc@symas.com,
jsurveyor@macquarie.net.au, nickc@redhat.com
Subject: Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
Date: Thu, 3 Apr 2003 11:19:47 -0500 (EST)
> This cannot be right: only gas understands the -TSO flag (is this true
> for all versions currently claimed to be supported on Solaris 2?), the
> native as certainly does not. I suppose this belongs to
> sol2-gas-bi.h.
> Rainer
Confirmed. My build this morning on solaris2.7 with native "as"
errored out when building libgcc in stage1. The native assembler
doesn't accept -TSO and gives this message:
usage: /usr/ccs/bin/as [-V] [-Q{y,n}] [-f[O][if]#] [-q] [-s]
[-S] [-K {pic,PIC}] [-o objfile] [-L] [-T]
[-P [[-Ipath] [-Dname] [-Dname=def] [-Uname]]...]
[-m [-Ym,path]] [-n] [-xF] [-xarch=v7] [-xarch=v8]
[-xarch=v8a] [-xarch=v8plus] [-xarch=v8plusa] [-xarch=v9]
[-xarch=v9a] [-xcode={pic13,pic32}] file.s...
make[2]: *** [sparcv9/libgcc.a] Error 57
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
@ 2003-04-03 16:16 Rainer Orth
0 siblings, 0 replies; 5+ messages in thread
From: Rainer Orth @ 2003-04-03 16:16 UTC (permalink / raw)
To: jakub; +Cc: gcc-prs
The following reply was made to PR target/8022; it has been noted by GNATS.
From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
To: Nick Clifton <nickc@redhat.com>
Cc: hyc@symas.com, jsurveyor@macquarie.net.au, gcc-patches@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Subject: Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
Date: 03 Apr 2003 18:10:14 +0200
Nick Clifton <nickc@redhat.com> writes:
> I am applying this patch, approved by Jakub in a private email, to fix
> the problem. With the patch applied, the specs file looks like this:
>
> *asm_cpu:
> %{mcpu=ultrasparc:%{!m64:-xarch=v8plusa}%{m64:-xarch=v9a -TSO}}
> %{mcpu=v9:%{!m64:-xarch=v8plus}%{m64:-xarch=v9 -TSO}}
> %{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:%{!m64:-xarch=v8}%{m64:-xarch=v9
> -TSO}}}} %{!mcpu*:%(asm_cpu_default)}
>
> *asm_cpu_default:
> %{m64:-xarch=v9 -TSO} %{!m64:}
This cannot be right: only gas understands the -TSO flag (is this true for
all versions currently claimed to be supported on Solaris 2?), the native
as certainly does not. I suppose this belongs to sol2-gas-bi.h.
Rainer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
@ 2003-04-03 10:26 Nick Clifton
0 siblings, 0 replies; 5+ messages in thread
From: Nick Clifton @ 2003-04-03 10:26 UTC (permalink / raw)
To: jakub; +Cc: gcc-prs
The following reply was made to PR target/8022; it has been noted by GNATS.
From: Nick Clifton <nickc@redhat.com>
To: hyc@symas.com, jsurveyor@macquarie.net.au
Cc: gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c/8022: gcc 3.2 Solaris 64 bit shared libraries
Date: 03 Apr 2003 11:20:21 +0100
Hi Hyc, Hi John
> 64 bit binaries produced by gcc 3.x "-m64" option and compiled by
> gas are unusable for shared libraries, by default. The gas --help
> says "-TSO" is the default but it actually defaults to
> "-RMO". /usr/ccs/bin/ld will link the object files without any
> complaint, but the runtime linker barfs. This issue was first
> reported on
>
> http://gcc.gnu.org/ml/gcc-help/2002-06/msg00005.html
>
> Adding "-TSO" to the specs file for the appropriate -m64 clauses
> fixes the problem.
I am applying this patch, approved by Jakub in a private email, to fix
the problem. With the patch applied, the specs file looks like this:
*asm_cpu:
%{mcpu=ultrasparc:%{!m64:-xarch=v8plusa}%{m64:-xarch=v9a -TSO}}
%{mcpu=v9:%{!m64:-xarch=v8plus}%{m64:-xarch=v9 -TSO}}
%{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:%{!m64:-xarch=v8}%{m64:-xarch=v9
-TSO}}}} %{!mcpu*:%(asm_cpu_default)}
*asm_cpu_default:
%{m64:-xarch=v9 -TSO} %{!m64:}
Cheers
Nick
2003-04-03 Nick Clifton <nickc@redhat.com>
* config/sparc/sol2-bi.h (ASM_CPU64_DEFAULT_SPEC): Add -TSO.
(DEF_ARCH64_SPEC): Likewise.
Index: gcc/config/sparc/sol2-bi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-bi.h,v
retrieving revision 1.8
diff -c -3 -p -w -r1.8 sol2-bi.h
*** gcc/config/sparc/sol2-bi.h 3 Oct 2002 20:35:14 -0000 1.8
--- gcc/config/sparc/sol2-bi.h 3 Apr 2003 10:12:15 -0000
***************
*** 10,16 ****
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC ""
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
#undef CPP_CPU64_DEFAULT_SPEC
--- 10,16 ----
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC ""
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG " -TSO"
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9
#undef CPP_CPU64_DEFAULT_SPEC
***************
*** 24,38 ****
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a"
#endif
#if DEFAULT_ARCH32_P
#define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{m64:" __str "}"
#else
#define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str "}"
#endif
#undef CPP_CPU_SPEC
--- 24,38 ----
#undef ASM_CPU32_DEFAULT_SPEC
#define ASM_CPU32_DEFAULT_SPEC "-xarch=v8plusa"
#undef ASM_CPU64_DEFAULT_SPEC
! #define ASM_CPU64_DEFAULT_SPEC AS_SPARC64_FLAG "a -TSO"
#endif
#if DEFAULT_ARCH32_P
#define DEF_ARCH32_SPEC(__str) "%{!m64:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{m64:" __str " -TSO}"
#else
#define DEF_ARCH32_SPEC(__str) "%{m32:" __str "}"
! #define DEF_ARCH64_SPEC(__str) "%{!m32:" __str " -TSO}"
#endif
#undef CPP_CPU_SPEC
^ permalink raw reply [flat|nested] 5+ messages in thread
* c/8022: gcc 3.2 Solaris 64 bit shared libraries
@ 2002-09-24 9:36 hyc
0 siblings, 0 replies; 5+ messages in thread
From: hyc @ 2002-09-24 9:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 8022
>Category: c
>Synopsis: gcc 3.2 Solaris 64 bit shared libraries
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Sep 24 09:36:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: hyc@symas.com
>Release: gcc-3.2, binutils 2.11.2
>Organization:
>Environment:
Solaris 2.8 Ultrasparc
>Description:
64 bit binaries produced by gcc 3.x "-m64" option and compiled by gas are unusable for shared libraries, by default. The gas --help says "-TSO" is the default but it actually defaults to "-RMO". /usr/ccs/bin/ld will link the object files without any complaint, but the runtime linker barfs. This issue was first reported on
http://gcc.gnu.org/ml/gcc-help/2002-06/msg00005.html
Adding "-TSO" to the specs file for the appropriate -m64 clauses fixes the problem.
>How-To-Repeat:
$ gcc -m64 -c foo.c (any valid C code will do)
$ /usr/ccs/bin/ld -G -o foo.so foo.o
$ gcc -m64 -o main main.c ./foo.so
$ ./main
ld.so.1: ./main: fatal: ./foo.so: bad ELF flags value: 2
>Fix:
lute:/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2# diff -c specs{.O,}
*** specs.O Tue Sep 24 04:46:03 2002
--- specs Tue Sep 24 09:08:17 2002
***************
*** 120,129 ****
%{pthreads:-D_REENTRANT -D_PTHREADS} %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}
*asm_cpu:
! %{mcpu=ultrasparc:%{!m64:-xarch=v8plusa}%{m64:-xarch=v9a}} %{mcpu=v9:%{!m64:-xarch=v8plus}%{m64:-xarch=v9}} %{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:%{!m64:-xarch=v8}%{m64:-xarch=v9}}}} %{!mcpu*:%(asm_cpu_default)}
*asm_cpu_default:
! %{m64:-xarch=v9} %{!m64:}
*asm_arch32:
--- 120,129 ----
%{pthreads:-D_REENTRANT -D_PTHREADS} %{!pthreads:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}} %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude}
*asm_cpu:
! %{mcpu=ultrasparc:%{!m64:-xarch=v8plusa}%{m64:-xarch=v9a -TSO}} %{mcpu=v9:%{!m64:-xarch=v8plus}%{m64:-xarch=v9 -TSO}} %{!mcpu=ultrasparc:%{!mcpu=v9:%{mcpu*:%{!m64:-xarch=v8}%{m64:-xarch=v9 -TSO}}}} %{!mcpu*:%(asm_cpu_default)}
*asm_cpu_default:
! %{m64:-xarch=v9 -TSO} %{!m64:}
*asm_arch32:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-04-04 13:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-04 13:06 c/8022: gcc 3.2 Solaris 64 bit shared libraries Nick Clifton
-- strict thread matches above, loose matches on Subject: below --
2003-04-03 16:26 Kaveh R. Ghazi
2003-04-03 16:16 Rainer Orth
2003-04-03 10:26 Nick Clifton
2002-09-24 9:36 hyc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).