This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

PA-RISC diffs, part 5: Assembler comment/line-separator changes


Because the standard comment character is ';' on hppa, we cannot use
it to separate statements in inline assembly code.  So we either
define an ASM_LINE_SEP macro and paste it, or simply use "\n\t".

Unfortunately this touches a number of pieces of generic code.

I'm going to blame Alan for it since he's the binutils guy :-)

2000-10-12  Alan Modra <alan@linuxcare.com.au>
	
	* config.h.in: Add ASM_LINE_SEP.
	* configure.in: Add test for comment and line separators.
	* libc-symbols.h: Define and use ASM_LINE_SEP, and add tabs to
	placate some hppa assemblers.
	* sysdeps/hppa/sysdep.h: Likewise.
	* sysdeps/gnu/siglist.c: Insert \n and \t into inline asm.
	* sysdeps/unix/sysv/linux/errlist.c: Likewise.

diff -urN --exclude=configure --exclude=.cvsignore --exclude=CVS --exclude=*.texi --exclude=texis --exclude=*.info* --exclude=*~ glibc-2.1.95/config.h.in glibc/config.h.in
--- glibc-2.1.95/config.h.in	Thu Jun 29 15:39:54 2000
+++ glibc/config.h.in	Tue Oct  3 13:11:02 2000
@@ -18,6 +18,10 @@
 /* Define if weak symbols are available via the `.weakext' directive.  */
 #undef	HAVE_ASM_WEAKEXT_DIRECTIVE
 
+/* Define to the assembler line separator character for multiple
+   assembler instructions per line.  Default is `;'  */
+#undef ASM_LINE_SEP
+
 /* Define if not using ELF, but `.init' and `.fini' sections are available.  */
 #undef	HAVE_INITFINI
 
diff -urN --exclude=configure --exclude=.cvsignore --exclude=CVS --exclude=*.texi --exclude=texis --exclude=*.info* --exclude=*~ glibc-2.1.95/configure.in glibc/configure.in
--- glibc-2.1.95/configure.in	Tue Oct 10 17:43:35 2000
+++ glibc/configure.in	Tue Oct 10 17:10:32 2000
@@ -1048,6 +1049,30 @@
 elif test $libc_cv_asm_weakext_directive = yes; then
   AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)
 fi
+
+dnl The standard hppa assembler uses `;' to start comments and `!'
+dnl as a line separator.
+case "${host_cpu}-${host_os}" in
+  hppa*linux*)
+  AC_CACHE_CHECK(for assembler line separator,
+		 libc_cv_asm_line_sep, [dnl
+  cat > conftest.s <<EOF
+ nop ; is_old_puffin
+EOF
+  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
+    libc_cv_asm_line_sep='!'
+  else
+    if test -z "$enable_hacker_mode"; then
+      echo "*** You need a newer assembler to compile glibc"
+      rm -f conftest*
+      exit 1
+    fi
+    libc_cv_asm_line_sep=';'
+  fi
+  rm -f conftest*])
+  AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
+  ;;
+esac
 
 AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl
 cat > conftest.c <<\EOF
diff -urN --exclude=configure --exclude=.cvsignore --exclude=CVS --exclude=*.texi --exclude=texis --exclude=*.info* --exclude=*~ glibc-2.1.95/include/libc-symbols.h glibc/include/libc-symbols.h
--- glibc-2.1.95/include/libc-symbols.h	Wed Aug  2 17:52:09 2000
+++ glibc/include/libc-symbols.h	Tue Oct  3 13:11:02 2000
@@ -76,6 +76,10 @@
 # endif
 #endif
 
+#ifndef ASM_LINE_SEP
+#define ASM_LINE_SEP ;
+#endif
+
 #ifndef __ASSEMBLER__
 /* GCC understands weak symbols and aliases; use its interface where
    possible, instead of embedded assembly language.  */
@@ -117,11 +121,11 @@
 
 # ifdef HAVE_ASM_SET_DIRECTIVE
 #  define strong_alias(original, alias)		\
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias);	\
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP	\
   .set C_SYMBOL_NAME (alias),C_SYMBOL_NAME (original)
 # else
 #  define strong_alias(original, alias)		\
-  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias);	\
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (alias) ASM_LINE_SEP	\
   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
 # endif
 
@@ -135,7 +139,7 @@
 #  else /* ! HAVE_ASM_WEAKEXT_DIRECTIVE */
 
 #   define weak_alias(original, alias)	\
-  .weak C_SYMBOL_NAME (alias);	\
+  .weak C_SYMBOL_NAME (alias) ASM_LINE_SEP	\
   C_SYMBOL_NAME (alias) = C_SYMBOL_NAME (original)
 
 #   define weak_extern(symbol)	\
@@ -175,14 +179,16 @@
 /* We want the .gnu.warning.SYMBOL section to be unallocated.  */
 #  ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
 #   define __make_section_unallocated(section_string)	\
-  asm(".section " section_string "; .previous");
+  asm (".section " section_string "\n\t.previous");
 #  elif defined HAVE_ASM_POPSECTION_DIRECTIVE
 #   define __make_section_unallocated(section_string)	\
-  asm(".pushsection " section_string "; .popsection");
+  asm (".pushsection " section_string "\n\t.popsection");
 #  else
 #   define __make_section_unallocated(section_string)
 #  endif
 
+/* Tacking on "\n\t#" to the section name makes gcc put it's bogus
+   section attributes on what looks like a comment to the assembler.  */
 #  ifdef HAVE_SECTION_QUOTES
 #   define link_warning(symbol, msg) \
   __make_section_unallocated (".gnu.warning." #symbol) \
@@ -196,8 +202,8 @@
 #  endif
 # else
 #  define link_warning(symbol, msg)		\
-  asm(".stabs \"" msg "\",30,0,0,0\n"	\
-      ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
+  asm (".stabs \"" msg "\",30,0,0,0\n\t"	\
+       ".stabs \"" __SYMBOL_PREFIX #symbol "\",1,0,0,0\n");
 # endif
 #else
 /* We will never be heard; they will all die horribly.  */
@@ -260,9 +266,9 @@
 # else	/* Not ELF: a.out.  */
 
 #  define text_set_element(set, symbol)	\
-  asm(".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
+  asm (".stabs \"" __SYMBOL_PREFIX #set "\",23,0,0," __SYMBOL_PREFIX #symbol)
 #  define data_set_element(set, symbol)	\
-  asm(".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
+  asm (".stabs \"" __SYMBOL_PREFIX #set "\",25,0,0," __SYMBOL_PREFIX #symbol)
 #  define bss_set_element(set, symbol)	?error Must use initialized data.
 #  define symbol_set_define(set)	void *const (set)[1];
 #  define symbol_set_declare(set)	extern void *const (set)[1];
diff -urN --exclude=configure --exclude=.cvsignore --exclude=CVS --exclude=*.texi --exclude=texis --exclude=*.info* --exclude=*~ glibc-2.1.95/sysdeps/gnu/siglist.c glibc/sysdeps/gnu/siglist.c
--- glibc-2.1.95/sysdeps/gnu/siglist.c	Tue Mar 28 14:05:42 2000
+++ glibc/sysdeps/gnu/siglist.c	Tue Oct  3 13:11:02 2000
@@ -33,7 +33,7 @@
 
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".data; .globl __old_sys_siglist;  __old_sys_siglist:");
+asm (".data\n\t.globl __old_sys_siglist\n__old_sys_siglist:");
 #endif
 
 const char *const __new_sys_siglist[NSIG] =
@@ -44,10 +44,10 @@
 };
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".type __old_sys_siglist,@object;.size __old_sys_siglist,"
+asm (".type __old_sys_siglist,@object\n\t.size __old_sys_siglist,"
         OLD_SIGLIST_SIZE_STR "*" PTR_SIZE_STR);
 
-asm (".data; .globl __old_sys_sigabbrev;  __old_sys_sigabbrev:");
+asm (".data\n\t.globl __old_sys_sigabbrev\n__old_sys_sigabbrev:");
 #endif
 
 const char *const __new_sys_sigabbrev[NSIG] =
@@ -58,7 +58,7 @@
 };
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".type __old_sys_sigabbrev,@object;.size __old_sys_sigabbrev,"
+asm (".type __old_sys_sigabbrev,@object\n\t.size __old_sys_sigabbrev,"
         OLD_SIGLIST_SIZE_STR "*" PTR_SIZE_STR);
 
 extern const char *const *__old_sys_siglist;
diff -urN --exclude=configure --exclude=.cvsignore --exclude=CVS --exclude=*.texi --exclude=texis --exclude=*.info* --exclude=*~ glibc-2.1.95/sysdeps/unix/sysv/linux/errlist.c glibc/sysdeps/unix/sysv/linux/errlist.c
--- glibc-2.1.95/sysdeps/unix/sysv/linux/errlist.c	Fri Apr  7 15:10:02 2000
+++ glibc/sysdeps/unix/sysv/linux/errlist.c	Tue Oct  3 13:11:02 2000
@@ -24,13 +24,13 @@
 #define SYS_NERR __new_sys_nerr
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".data; .globl __old_sys_errlist;  __old_sys_errlist:");
+asm (".data\n\t.globl __old_sys_errlist\n__old_sys_errlist:");
 #endif
 
 #include <sysdeps/gnu/errlist.c>
 
 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
-asm (".type __old_sys_errlist,@object;.size __old_sys_errlist,"
+asm (".type __old_sys_errlist,@object\n\t.size __old_sys_errlist,"
      OLD_ERRLIST_SIZE_STR "*" PTR_SIZE_STR);
 
 extern const char *const *__old_sys_errlist;


-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.

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