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

[Bug admin/19543] New: documentation: X32 ABI port and portable test for X32


https://sourceware.org/bugzilla/show_bug.cgi?id=19543

            Bug ID: 19543
           Summary: documentation: X32 ABI port and portable test for X32
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: admin
          Assignee: unassigned at sourceware dot org
          Reporter: noloader at gmail dot com
                CC: carlos at redhat dot com, roland at gnu dot org
  Target Milestone: ---

The glibc x32 wiki page states the following
(http://sourceware.org/glibc/wiki/x32):

  x86-64 vs. x32

    ...
    * x86-64 C/C++ compiler predefines macro __LP64__
      while x32 C/C++ compiler predefines macro __ILP32__.

Previously, we were following the advice and testing for just __ILP32__. It
worked great under GCC and ICC, but it broke under Clang.

Clang defines __ILP32__ for any 32-bit platform, including ARM and possibly
ARM64/AARCH64 platforms. They don't limit use of __ILP32__ to Intel 64-bit
platforms.

If a developer wants a portable test for X32, then the preprocessor macro test
should include both:

    #if defined(__ILP32__) && (defined(__x86_64__) || defined(__amd64__))
       /* Its X32 */
    #endif

Also see http://lists.llvm.org/pipermail/cfe-dev/2015-December/046306.html on
the LLVM-dev mailing list.

My apologies for the report against the wiki page. If free software developers
are aware of Clang behavior, then their stuff will "just work", and they won't
have to take the bug report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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