[LLVMbugs] [Bug 23729] New: Clang has missing/different macros than gcc - causing compatibility issues

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 2 03:50:31 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23729

            Bug ID: 23729
           Summary: Clang has missing/different macros than gcc - causing
                    compatibility issues
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: npl at chello.at
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14419
  --> https://llvm.org/bugs/attachment.cgi?id=14419&action=edit
gcc defines

Hello,

I tried compiling out project at work, which is a realtime firmware for arm.
Ideally clang would be just able to generate correct code, but it misbehaves on
a few accounts. I consider some of these macros pretty much defacto-standard,
as eg. newlib is using and depending on these.

__SOFTFP__ is not set, implicating hardware floating point support
__USES_INITFINI__ is not set, resulting in initialisation functions not being
called

And several macros are quite different:
__ARM_SIZEOF_WCHAR_T  32  vs.  4
__FLT_* sizes are different, probably just nonrelevant extra precision
__INTPTR_TYPE__,__UINT32_TYPE__,__WINT_TYPE__ etc.   int vs. long int (kills
binary compatibility)

I used these 2 commands (clang needed the system directories defined, din`t
pick them up correctly)
LC_ALL=C /opt/toolchain/bin/arm-none-eabi-g++ -fmessage-length=0 -DNVALGRIND
-Wignored-qualifiers -mcpu=arm926ej-s -fstrict-aliasing -ftls-model=local-exec
-fno-threadsafe-statics -ffunction-sections -fdata-sections
-mpoke-function-name -DPOKE_FUNCTION_NAME -Wpointer-arith -Wno-psabi
-Wsign-compare -fstrict-overflow -Wnoexcept -std=gnu++11 -Wall -O2 -g2  \
           \
            -E -P -dD -x c++ -v - < /dev/null 2>&1


LC_ALL=C /opt/toolchain/bin/arm-none-eabi-clang++ -fmessage-length=0
-DNVALGRIND -Wignored-qualifiers -mcpu=arm926ej-s -fstrict-aliasing
-ftls-model=local-exec -fno-threadsafe-statics -ffunction-sections
-fdata-sections -fshort-enums -fshort-enums -Wpointer-arith -Wsign-compare
-Wimplicit-fallthrough -std=gnu++11 -Wall -O2 -g3  \
           \
        -nostdinc
-I/opt/toolchain-4.8/lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/include/c++/4.8.4
-I/opt/toolchain-4.8/lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/include/c++/4.8.4/arm-none-eabi/armv5te
-I/opt/toolchain-4.8/lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/include/c++/4.8.4/backward
-I/opt/toolchain-4.8/lib/gcc/arm-none-eabi/4.8.4/include
-I/opt/toolchain-4.8/lib/gcc/arm-none-eabi/4.8.4/include-fixed
-I/opt/toolchain-4.8/lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/include 
        \ 
        -E -P -dD -x c++ -v - < /dev/null 2>&1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150602/aa261d13/attachment.html>


More information about the llvm-bugs mailing list