This is the mail archive of the gcc-bugs@gcc.gnu.org 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]
Other format: [Raw text]

preprocessor/5886: IA64 ABI predefined symbol missing



>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:


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