[LLVMbugs] [Bug 5119] New: Autoconf test for "cdecl" fails on OS X compiling Ruby 1.9/ trunk

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Oct 2 02:48:30 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=5119

           Summary: Autoconf test for "cdecl" fails on OS X compiling Ruby
                    1.9/trunk
           Product: Build scripts
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: autoconf
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: roberto at freebsd.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3602)
 --> (http://llvm.org/bugs/attachment.cgi?id=3602)
config.log from clang

The configure for Ruby script tries to find what needs to be used for "cdecl"
function attributes.  It seems that either the test is flawed or clang has a
different behaviour.

configure is run with

CC=clang CFLAGS="-Os -m64" LDFLAGS="-m64"

Configure test is the following:
-----
AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
m4_ifval([$2], dnl
  [AS_VAR_PUSHDEF([attrib],[$2])], dnl
  [AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
)dnl
m4_ifval([$3], dnl
  [AS_VAR_PUSHDEF([rbcv],[$3])], dnl
  [AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
)dnl
m4_ifval([$4], [rbcv_cond=[$4]; test "$rbcv_cond" || unset rbcv_cond])
AC_CACHE_CHECK(for [$1] function attribute, rbcv,
[rbcv=x
if test "${ac_c_werror_flag+set}"; then
  rb_c_werror_flag="$ac_c_werror_flag"
else
  unset rb_c_werror_flag
fi
ac_c_werror_flag=yes
for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x"
x; do
  m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
  AC_TRY_COMPILE(
    m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
[@%:@define ]attrib[(x) $mac]
m4_ifval([$4],${rbcv_cond+[@%:@else]}
${rbcv_cond+[@%:@define ]attrib[(x) x]}
${rbcv_cond+[@%:@endif]})
    attrib[(void conftest_attribute_check(void));], [],
    [rbcv="$mac"; break])
done
if test "${rb_c_werror_flag+set}"; then
  ac_c_werror_flag="$rb_c_werror_flag"
else
  unset ac_c_werror_flag
fi
])
if test "$rbcv" != x; then
    RUBY_DEFINE_IF([${rbcv_cond}], attrib[(x)], $rbcv)
fi
AS_VAR_POPDEF([attrib])
AS_VAR_POPDEF([rbcv])
])

RUBY_FUNC_ATTRIBUTE(noreturn, NORETURN)
RUBY_FUNC_ATTRIBUTE(deprecated, DEPRECATED)
RUBY_FUNC_ATTRIBUTE(noinline, NOINLINE)

if_i386=${universal_binary+[defined __i386__]}
RUBY_FUNC_ATTRIBUTE(stdcall,  [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(cdecl,    [], [], ${if_i386})
RUBY_FUNC_ATTRIBUTE(fastcall, [], [], ${if_i386})
----- 

The failing one is 
RUBY_FUNC_ATTRIBUTE(cdecl,    [], [], ${if_i386})

because the config.h ends up with
#define FUNC_CDECL(x) __declspec(cdecl) x

gcc 4.2 manage to get this correctly (see config.log.gcc)

Attached are config.log (clang) and config.log.gcc.

Clang is trunk at r82982.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list