This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Tru64 UNIX V5.1] Use old assembler to allow bootstrapping

I just tried to bootstrap a recent CVS version (3.0 20010221 (prerelease))
on Tru64 UNIX V5.1.  At first attempt, I failed when the stage1 compiler
tried to build _clz.o from libgcc2.c:

% ./xgcc -B./ -B/vol/gcc/share/alpha-dec-osf5.1/bin/ -isystem /vol/gcc/share/alpha-dec-osf5.1/include -O2   -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I/vol/gnu/src/gcc/gcc-3.0-branch/gcc -I/vol/gnu/src/gcc/gcc-3.0-branch/gcc/. -I/vol/gnu/src/gcc/gcc-3.0-branch/gcc/config -I/vol/gnu/src/gcc/gcc-3.0-branch/gcc/../include -DUSE_COLLECT2 -DL_clz -c /vol/gnu/src/gcc/gcc-3.0-branch/gcc/libgcc2.c -o libgcc/./_clz.o
mips-tfile, /tmp/cc1f44T8.s:8 Invalid .stabs/.stabn directive, value not found
line:    #.stabs        "/var/cluster/members/member0/tmp/gcc/gcc/",100,0,0,$Ltext0

mips-tfile, /tmp/cc1f44T8.s:9 Invalid .stabs/.stabn directive, value not found
line:    #.stabs        "/vol/gnu/src/gcc/gcc-3.0-branch/gcc/libgcc2.c",100,0,0,$Ltext0

It turns out that $Ltext0 is missing from the initial as-created _clz.o,
before feeding it to mips-tfile:

Name                                    Value        Type       Size

__clz_tab                        | 0000000000000008 | R | 0000000000000000

On Tru64 UNIX V4.0F, this file's symbol table looks like

$Ltext0                          | 0000000000000000 | N | 0000000000000000
__clz_tab                        | 0000000000000008 | R | 0000000000000000

I'll investigate further what causes this difference, but have a workaround
for now which allows me to bootstrap gcc: there's an undocumented assembler
flag, -oldas, which instructs the assembler driver to use the old
assembler, /usr/lib/cmplrs/cc/as[01] instead of the new one, .../adu.  This
was mentioned on a posting to the Tru64-UNIX-Managers mailing list:

I've checked that the new assembler (adu) is only present on V5.1, V4.0*
and V5.0/5.0A (including patch kits) lack it (and the -oldas flag in
/usr/lib/cmplrs/cc/driver).  Instead of hardcoding this, I decided to
implement an autoconf test for this, but later found that at least the
V4.0F assembler driver just ignores -oldas.  It's probably best to just
leave the test in anyway.

The following patch cleanly implements passing this flag to as, without the
need for a wrapper script.  This allowed me to bootstrap the compiler; I'll
deal with build failures in libstdc++-v3 and libobjc in separate messages.
PR c++/1594 is the same issue, and can thus be closed.


Rainer Orth, Faculty of Technology, Bielefeld University

Email: ro@TechFak.Uni-Bielefeld.DE

Fri Feb 23 18:12:00 2001  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* Check if assembler supports -oldas.
	* configure, Rebuilt.
	* alpha/osf.h (OLDAS_SPEC): Define.

RCS file: /cvs/gcc/egcs/gcc/,v
retrieving revision 1.483
diff -u -p -r1.483
---	2001/02/12 07:35:03	1.483
+++	2001/02/23 19:04:21
@@ -1303,6 +1305,27 @@ fi
 case "$target" in 
+  alpha*-*-osf*)
+    AC_CACHE_CHECK([assembler supports -oldas],
+	gcc_cv_as_oldas_opt, [
+	gcc_cv_as_oldas_opt=unknown
+	if test x$gcc_cv_as != x; then
+	    # Check if gas supports -oldas
+	    echo ".text" > conftest.s
+	    if $gcc_cv_as -oldas -o conftest.o conftest.s > /dev/null 2>&1; then
+		gcc_cv_as_oldas_opt=yes
+	    else
+		gcc_cv_as_oldas_opt=no
+	    fi
+	    rm -f conftest.s conftest.o
+	fi
+    ])
+    if test "x$gcc_cv_as_oldas_opt" = xyes; then
+		[Define if your assembler supports -oldas option.])
+    fi
+    ;;
     AC_CACHE_CHECK([assembler .register pseudo-op support],
 	gcc_cv_as_register_pseudo_op, [
Index: config/alpha/osf.h
RCS file: /cvs/gcc/egcs/gcc/config/alpha/osf.h,v
retrieving revision 1.15
diff -u -p -r1.15 osf.h
--- osf.h	2001/01/13 12:34:02	1.15
+++ osf.h	2001/02/23 19:04:21
@@ -79,10 +79,23 @@ Boston, MA 02111-1307, USA.  */
   ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename);	\
+/* In Tru64 UNIX V5.1, Compaq introduced a new assembler
+   (/usr/lib/cmplrs/cc/adu) which currently breaks mips-tfile.  Passing the
+   undocumented -oldas flag reverts to using the old assembler
+   (/usr/lib/cmplrs/cc/as[01]).  To avoid hardcoding which O/S versions
+   support this flag, it is tested at configure time.  This may not be
+   necessary, since at least the V4.0F assembler just ignores -oldas.  */
+#define OLDAS_SPEC " -oldas"
+#define OLDAS_SPEC ""
 /* No point in running CPP on our assembler output.  */
 /* Don't pass -g to GNU as, because some versions don't accept this option.  */
-#define ASM_SPEC "%{malpha-as:-g} -nocpp %{pg}"
+#define ASM_SPEC "%{malpha-as:-g" OLDAS_SPEC "} -nocpp %{pg}"
 /* In OSF/1 v3.2c, the assembler by default does not output file names which
    causes mips-tfile to fail.  Passing -g to the assembler fixes this problem.
@@ -91,7 +104,7 @@ Boston, MA 02111-1307, USA.  */
    if the user does not specify -g.  If we don't pass -g, then mips-tfile
    will need to be fixed to work in this case.  Pass -O0 since some
    optimization are broken and don't help us anyway.  */
-#define ASM_SPEC "%{!mgas:-g} -nocpp %{pg} -O0"
+#define ASM_SPEC "%{!mgas:-g" OLDAS_SPEC "} -nocpp %{pg} -O0"
 /* Specify to run a post-processor, mips-tfile after the assembler

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]