lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On May 8, 2013, at 4:21 PM, Roberto Ierusalimschy wrote:

>> J2: Invoking clang in the "-m32" model on Mac-10.6 results in the same
>> miscompilation as J1.
> 
> Are you sure about this point? I cound not find any message reporting
> this bug with clang. (Or have you tested it yourself?)

On 10.6.8 with Xcode 3.6.2:

$ ksh test-options
clang: Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
llvm-gcc: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.6)
gcc: gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
clang -m32 : ***** FAIL
clang -m32 -DUSE_AUXCLOSE_ASM: pass
clang -m64 : pass
clang -m64 -DUSE_AUXCLOSE_ASM: pass
llvm-gcc -m32 : ***** FAIL
llvm-gcc -m32 -DUSE_AUXCLOSE_ASM: pass
llvm-gcc -m64 : pass
llvm-gcc -m64 -DUSE_AUXCLOSE_ASM: pass
gcc -m32 : pass
gcc -m32 -DUSE_AUXCLOSE_ASM: pass
gcc -m64 : pass
gcc -m64 -DUSE_AUXCLOSE_ASM: pass

On 10.7 with April 2013 Xcode:

$ ksh test-options
clang: Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
llvm-gcc: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
gcc: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
clang -m32 : pass
clang -m32 -DUSE_AUXCLOSE_ASM: pass
clang -m64 : pass
clang -m64 -DUSE_AUXCLOSE_ASM: pass
llvm-gcc -m32 : ***** FAIL
llvm-gcc -m32 -DUSE_AUXCLOSE_ASM: pass
llvm-gcc -m64 : pass
llvm-gcc -m64 -DUSE_AUXCLOSE_ASM: pass
gcc -m32 : ***** FAIL
gcc -m32 -DUSE_AUXCLOSE_ASM: pass
gcc -m64 : pass
gcc -m64 -DUSE_AUXCLOSE_ASM: pass

The script:

#!/bin/ksh

clean() {
  make clean >/dev/null
}

build() {
  make macosx "CC=$CC" >/dev/null
}

test() {
  trap false 10
  src/lua -e 'io.open("/dev/null"):close()' >/dev/null 2>/dev/null &&
        echo 'pass' || echo '***** FAIL'
}

version() {
  echo -n "$CC: "
  $CC -v 2>&1 | grep version
}

for CC in clang llvm-gcc gcc; do
  version
done

for CC in {clang,llvm-gcc,gcc}\ {-m32,-m64}\ {,-DUSE_AUXCLOSE_ASM}; do
  echo -n "$CC: "
  clean
  build
  test 2>/dev/null
done