Re: [PATCH, alpha]: Use generic config/elfos.h headers

2012-03-22 Thread Richard Henderson
On 03/22/12 09:49, Uros Bizjak wrote:
> The #define is now brought in form the generic elfos.h. We need to

Ah, right.  Ok.


r~


Re: [PATCH, alpha]: Use generic config/elfos.h headers

2012-03-22 Thread Uros Bizjak
On Thu, Mar 22, 2012 at 5:24 PM, Richard Henderson  wrote:
> On 03/22/12 00:47, Uros Bizjak wrote:
>> No, we are still calling default_file_start in alpha_file_start, so we
>> have to signal that we don't want start file directive. In committed
>> patch, I have redefined T_A_F_S_F_D as false for this purpose:
>
> But false is the default:
>
> DEFHOOKPOD
> (asm_file_start_file_directive,
>  "",
>  bool, false)
>
> This only needed overriding when alpha.c was forcing T_A_F_S_F_D true.

The #define is now brought in form the generic elfos.h. We need to
either undefine it, or redefine it to false. I have chosen the later,
to explicitly state that we don't want .file directives.

Uros.


Re: [PATCH, alpha]: Use generic config/elfos.h headers

2012-03-22 Thread Richard Henderson
On 03/22/12 00:47, Uros Bizjak wrote:
> No, we are still calling default_file_start in alpha_file_start, so we
> have to signal that we don't want start file directive. In committed
> patch, I have redefined T_A_F_S_F_D as false for this purpose:

But false is the default:

DEFHOOKPOD
(asm_file_start_file_directive,
 "",
 bool, false)

This only needed overriding when alpha.c was forcing T_A_F_S_F_D true.


r~


Re: [PATCH, alpha]: Use generic config/elfos.h headers

2012-03-22 Thread Uros Bizjak
On Wed, Mar 21, 2012 at 11:37 PM, Richard Henderson  wrote:

>> Attached patch enables alpha to use generic config/elfos.h headers on
>> linux and *bsd targets. The most important difference to generic
>> elfos.h is in
>>
>>       * config/alpha/elf.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Undefine.
>
> This one can be deleted, since

No, we are still calling default_file_start in alpha_file_start, so we
have to signal that we don't want start file directive. In committed
patch, I have redefined T_A_F_S_F_D as false for this purpose:

+/* Do not output a .file directive at the beginning of the input file.  */
+
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false

>> +#undef USER_LABEL_PREFIX
>>  #define USER_LABEL_PREFIX ""
>
> This ought to be deletable.
>
>>  /* We use the default ASCII-output routine, except that we don't write more
>>     than 50 characters since the assembler doesn't support very long lines.  
>> */
>>
>> +#undef ASM_OUTPUT_ASCII
>>  #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
>
> Likewise.  Since RO deleted all non-gas support.

Both removed.

Attached is the patch that was re-tested and committed.

Thanks,
Uros.
Index: config/alpha/elf.h
===
--- config/alpha/elf.h  (revision 185597)
+++ config/alpha/elf.h  (working copy)
@@ -19,95 +19,18 @@
 along with GCC; see the file COPYING3.  If not see
 .  */
 
-#define OBJECT_FORMAT_ELF
-
-#define DWARF2_DEBUGGING_INFO 1
-
-#undef  PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-#undef ASM_FINAL_SPEC
-
-/* alpha/ doesn't use elfos.h for some reason.  */
-#define TARGET_OBJFMT_CPP_BUILTINS()   \
-  do   \
-{  \
-   builtin_define ("__ELF__"); \
-}  \
-  while (0)
-
 #undef  CC1_SPEC
 #define CC1_SPEC  "%{G*}"
 
 #undef  ASM_SPEC
 #define ASM_SPEC  "%{G*} %{relax:-relax} 
%{!gstabs*:-no-mdebug}%{gstabs*:-mdebug}"
 
-#undef  IDENT_ASM_OP
-#define IDENT_ASM_OP "\t.ident\t"
+/* Do not output a .file directive at the beginning of the input file.  */
+ 
+#undef TARGET_ASM_FILE_START_FILE_DIRECTIVE
+#define TARGET_ASM_FILE_START_FILE_DIRECTIVE false
 
-/* Output #ident as a .ident.  */
-#undef  ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(FILE, NAME) \
-  fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
-
-/* This is how to allocate empty space in some section.  The .zero
-   pseudo-op is used for this on most svr4 assemblers.  */
-
-#undef  SKIP_ASM_OP
-#define SKIP_ASM_OP"\t.zero\t"
-
-#undef  ASM_OUTPUT_SKIP
-#define ASM_OUTPUT_SKIP(FILE, SIZE) \
-  fprintf (FILE, "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n", SKIP_ASM_OP, (SIZE))
-
-/* Output the label which precedes a jumptable.  Note that for all svr4
-   systems where we actually generate jumptables (which is to say every
-   svr4 target except i386, where we use casesi instead) we put the jump-
-   tables into the .rodata section and since other stuff could have been
-   put into the .rodata section prior to any given jumptable, we have to
-   make sure that the location counter for the .rodata section gets pro-
-   perly re-aligned prior to the actual beginning of the jump table.  */
-
-#undef  ALIGN_ASM_OP
-#define ALIGN_ASM_OP "\t.align\t"
-
-#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
-#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
-  ASM_OUTPUT_ALIGN ((FILE), 2);
-#endif
-
-#undef  ASM_OUTPUT_CASE_LABEL
-#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE)\
-  do { \
-ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE)
\
-(*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); 
\
-  } while (0)
-
-/* The standard SVR4 assembler seems to require that certain builtin
-   library routines (e.g. .udiv) be explicitly declared as .globl
-   in each assembly file where they are referenced.  */
-
-#undef  ASM_OUTPUT_EXTERNAL_LIBCALL
-#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
-  (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
-
 /* This says how to output assembler code to declare an
-   uninitialized external linkage data object.  Under SVR4,
-   the linker seems to want the alignment of data objects
-   to depend on their types.  We do exactly that here.  */
-
-#undef  COMMON_ASM_OP
-#define COMMON_ASM_OP  "\t.comm\t"
-
-#undef  ASM_OUTPUT_ALIGNED_COMMON
-#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
-do {   \
-  fprintf ((FILE), "%s", COMMON_ASM_OP);   \
-  assemble_name ((FILE), (NAME));  \
-  fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNE

Re: [PATCH, alpha]: Use generic config/elfos.h headers

2012-03-21 Thread Richard Henderson
On 03/21/12 12:28, Uros Bizjak wrote:
> Hello!
> 
> Attached patch enables alpha to use generic config/elfos.h headers on
> linux and *bsd targets. The most important difference to generic
> elfos.h is in
> 
>   * config/alpha/elf.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Undefine.

This one can be deleted, since

2012-03-14  Rainer Orth  

...
* config/alpha/alpha.c (alpha_file_start): Always assume
OBJECT_FORMAT_ELF.
Don't set targetm.asm_file_start_file_directive.
[!OBJECT_FORMAT_ELF]: Remove.
(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Remove.

The patch looks ok, with,

> +#undef USER_LABEL_PREFIX
>  #define USER_LABEL_PREFIX ""

This ought to be deletable.

>  /* We use the default ASCII-output routine, except that we don't write more
> than 50 characters since the assembler doesn't support very long lines.  
> */
>  
> +#undef ASM_OUTPUT_ASCII
>  #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \

Likewise.  Since RO deleted all non-gas support.


r~


[PATCH, alpha]: Use generic config/elfos.h headers

2012-03-21 Thread Uros Bizjak
Hello!

Attached patch enables alpha to use generic config/elfos.h headers on
linux and *bsd targets. The most important difference to generic
elfos.h is in

* config/alpha/elf.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Undefine.

and

* config/alpha/alpha.h (NO_DOLLAR_IN_LABEL): Undefine.

Otherwise, the patch is very carefully written to not change anything
in alpha.h (it only #undefines some symbols before #define and removes
READOLNY_DATA_SECTION_ASM_OP that is always defined elsewhere), so VMS
target should continue to work without problems.

2012-03-21  Uros Bizjak  

* config.gcc (alpha*-*-linux*): Add elfos.h to tm_file.
(alpha*-*-freebsd*): Ditto.
(alpha*-*-netbsd*): Ditto.
(alpha*-*-openbsd*): Ditto.
* config/alpha/elf.h (OBJECT_FORMAT_ELF): Remove.
(DWARF2_DEBUGGING_INFO): Remove.
(PREFERRED_DEBUGGING_TYPE): Remove.
(ASM_FINAL_SPEC): Remove.
(IDENT_ASM_OP): Remove.
(ASM_OUTPUT_IDENT): Remove.
(SKIP_ASM_OP): Remove.
(ASM_OUTPUT_SKIP): Remove.
(ALIGN_ASM_OP): Remove.
(ASM_OUTPUT_BEFORE_CASE_LABEL): Remove.
(ASM_OUTPUT_CASE_LABEL): Remove.
(ASM_OUTPUT_EXTERNAL_LIBCALL): Remove.
(COMMON_ASM_OP): Remove.
(ASM_OUTPUT_ALIGNED_COMMON): Remove.
(ASCII_DATA_ASM_OP): Remove.
(READONLY_DATA_SECTION_ASM_OP): Remove.
(INIT_SECTION_ASM_OP): Remove.
(FINI_SECTION_ASM_OP): Remove.
(ASM_SECTION_START_OP): Remove.
(ASM_OUTPUT_SECTION_START_FILE): Remove.
(TARGET_ASM_NAMED_SECTION): Remove.
(TARGET_ASM_SELECT_SECTION): Remove.
(MAKE_DECL_ONE_ONLY): Remove.
(TYPE_ASM_OP): Remove.
(SIZE_ASM_OP): Remove.
(ASM_WEAKEN_LABEL): Remove.
(TYPE_OPERAND_FMT): Remove.
(ASM_DECLARE_RESULT): Remove.
(ASM_DECLARE_OBJECT_NAME): Remove.
(ASM_FINISH_DECLARE_OBJECT): Remove.
(ELF_ASCII_ESCAPES): Remove.
(ELF_STRING_LIMIT): Remove.
(STRING_ASM_OP): Remove.
(ASM_OUTPUT_EXTERNAL): Remove.
(TARGET_ASM_FILE_START_FILE_DIRECTIVE): Undefine.
* config/alpha/alpha.h (PCC_BITFIELD_TYPE_MATTERS): Undefine
before define.
(ASM_DECLARE_FUNCTION_NAME): Ditto.
(ASM_DECLARE_FUNCTION_SIZE): Ditto.
(USER_LABEL_PREFIX): Ditto.
(ASM_GENERATE_INTERNAL_LABEL): Ditto.
(ASM_OUTPUT_ASCII): Ditto.
(ASM_OUTPUT_SKIP): Ditto.
(READONLY_DATA_SECTION_ASM_OP): Remove.
(ASM_OUTPUT_CASE_LABEL): Remove.
(NO_DOLLAR_IN_LABEL): Undefine.

Patch was bootstrapped and regression tested on alphaev68-pc-linux-gnu.

OK for mainline?

Uros.
Index: config/alpha/alpha.h
===
--- config/alpha/alpha.h(revision 185578)
+++ config/alpha/alpha.h(working copy)
@@ -284,6 +284,7 @@
 #define STRUCTURE_SIZE_BOUNDARY 8
 
 /* A bit-field declared as `int' forces `int' alignment for the struct.  */
+#undef PCC_BITFILED_TYPE_MATTERS
 #define PCC_BITFIELD_TYPE_MATTERS 1
 
 /* No data type wants to be aligned rounder than this.  */
@@ -700,11 +701,13 @@
 
 /* This macro produces the initial definition of a function.  */
 
+#undef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
   alpha_start_function(FILE,NAME,DECL);
 
 /* This macro closes up a function definition for the assembler.  */
 
+#undef ASM_DECLARE_FUNCTION_SIZE
 #define ASM_DECLARE_FUNCTION_SIZE(FILE,NAME,DECL) \
   alpha_end_function(FILE,NAME,DECL)
 
@@ -982,10 +985,6 @@
 
 #define TEXT_SECTION_ASM_OP "\t.text"
 
-/* Output before read-only data.  */
-
-#define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
-
 /* Output before writable data.  */
 
 #define DATA_SECTION_ASM_OP "\t.data"
@@ -1022,12 +1021,14 @@
 
 /* The prefix to add to user-visible assembler symbols.  */
 
+#undef USER_LABEL_PREFIX
 #define USER_LABEL_PREFIX ""
 
 /* This is how to output a label for a jump table.  Arguments are the same as
for (*targetm.asm_out.internal_label), except the insn for the jump table is
passed.  */
 
+#undef ASM_OUTPUT_CASE_LABEL
 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN)   \
 { ASM_OUTPUT_ALIGN (FILE, 2); (*targetm.asm_out.internal_label) (FILE, PREFIX, 
NUM); }
 
@@ -1036,12 +1037,14 @@
PREFIX is the class of label and NUM is the number within the class.
This is suitable for output with `assemble_name'.  */
 
+#undef ASM_GENERATE_INTERNAL_LABEL
 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)  \
   sprintf ((LABEL), "*$%s%ld", (PREFIX), (long)(NUM))
 
 /* We use the default ASCII-output routine, except that we don't write more
than 50 characters since the assembler doesn't support very long lines.  */
 
+#undef ASM_OUTPUT_ASCII
 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
   do {   \
 FILE *_hide_asm_