public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* preprocessor/5886: IA64 ABI predefined symbol missing
@ 2002-03-08 10:26 nick
  0 siblings, 0 replies; 2+ messages in thread
From: nick @ 2002-03-08 10:26 UTC (permalink / raw)
  To: gcc-gnats; +Cc: nick


>Number:         5886
>Category:       preprocessor
>Synopsis:       The Intel IA64 ABI states that the symbol _LP64 will be predefined
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 08 10:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Nick Stoughton
>Release:        3.2 20020307 (experimental)
>Organization:
USENIX Association
>Environment:
System: Linux lsb 2.4.9-mckinley-smp #1 SMP Mon Sep 24 16:25:57 MDT 2001 ia64 unknown
Architecture: ia64

	
host: ia64-unknown-linux-gnu
build: ia64-unknown-linux-gnu
target: ia64-unknown-linux-gnu
configured with: ./configure 
>Description:
	Section 7.2 of the Intel (r) Itanium (tm) processor specific Application
Binary Interface (see http://developer.intel.com/design/itanium/downloads/245370.htm)
states that the symbol _LP64 should be predefined for IA64 target with LP64 architecture.
The symbol __LP64__ is defined, but not _LP64.

Also, there should be an assertion for the default endian case, -Aendian(little), in the
preprocessor initialization. If it is possible to produce big-endian Itanium code (and I 
haven't figured out yet if you can), then this assertion should track the compiler flag
to produce bigendian code. Otherwise, it can be handled by the patch attached.

NOTE both this predefined symbol and the assertion are being added to the IA64
processor-specific Linux Standards Base document, which is about to be completed. If this
report CANNOT be accomodated, please let me know quickly, so I can change the standard before
it is too late (I am the responsible author for this section of the LSB).

The fix below applies only to linux systems, and not to all IA64 systems. Since
this symbol and assertion are required by the Intel ABI, it might be better to move them
to a higher level file. However, for my use, I only require these symbols for Linux systems;
the standard I am developing is the Linux Standards Base; so I have supplied a fix for that
target only.

>How-To-Repeat:
	cp /dev/null x.c
	gcc -dM -E x.c
>Fix:
	Apply following patch:
*** gcc/config/ia64/linux.h	Fri Mar  8 10:07:55 2002
--- gcc/config/ia64/linux.h.old	Sun Jan 20 18:24:02 2002
***************
*** 12,19 ****
  /* ??? Maybe this should be in sysv4.h?  */
  #define CPP_PREDEFINES "\
  -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix \
! -D_LP64 -D__LP64__ -D__ELF__ -Asystem=linux -Acpu=ia64 -Amachine=ia64 \
! -Aendian=little"
  
  /* ??? ia64 gas doesn't accept standard svr4 assembler options?  */
  #undef ASM_SPEC
--- 12,18 ----
  /* ??? Maybe this should be in sysv4.h?  */
  #define CPP_PREDEFINES "\
  -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix \
! -D__LP64__ -D__ELF__ -Asystem=linux -Acpu=ia64 -Amachine=ia64"
  
  /* ??? ia64 gas doesn't accept standard svr4 assembler options?  */
  #undef ASM_SPEC

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: preprocessor/5886: IA64 ABI predefined symbol missing
@ 2002-03-08 11:06 Zack Weinberg
  0 siblings, 0 replies; 2+ messages in thread
From: Zack Weinberg @ 2002-03-08 11:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/5886; it has been noted by GNATS.

From: Zack Weinberg <zack@codesourcery.com>
To: nick@usenix.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/5886: IA64 ABI predefined symbol missing
Date: Fri, 8 Mar 2002 10:58:10 -0800

 > 	Section 7.2 of the Intel (r) Itanium (tm) processor specific
 > Application Binary Interface (see
 > http://developer.intel.com/design/itanium/downloads/245370.htm)
 > states that the symbol _LP64 should be predefined for IA64 target
 > with LP64 architecture.  The symbol __LP64__ is defined, but not
 > _LP64.
 
 There's no problem adding this; _LP64 is in the implementation name
 space.  You'll need to get it approved by an ia64 arch maintainer,
 though.
 
 >  Also, there should be an assertion for the default endian case,
 > -Aendian(little), in the preprocessor initialization. If it is
 > possible to produce big-endian Itanium code (and I haven't figured
 > out yet if you can), then this assertion should track the compiler
 > flag to produce bigendian code. Otherwise, it can be handled by the
 > patch attached.
 
 Preprocessor assertions are deprecated.  We will add them to GCC's
 configuration files only when they are necessary for compatibility
 with other compilers.  Please remove all mention of assertions from
 standards documents you control, and encourage other standards
 developers to do the same.
 
 The switches you are looking for are -mbig-endian and
 -mlittle-endian.  See ia64.h.
 
 >  The fix below applies only to linux systems, and not to all IA64
 > systems. Since this symbol and assertion are required by the Intel
 > ABI, it might be better to move them to a higher level
 > file.
 
 Yes, this stuff belongs in ia64.h.
 
 zw


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-08 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-08 10:26 preprocessor/5886: IA64 ABI predefined symbol missing nick
2002-03-08 11:06 Zack Weinberg

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).