gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] GCL on Mac OS X (Mountain Lion)


From: Camm Maguire
Subject: Re: [Gcl-devel] GCL on Mac OS X (Mountain Lion)
Date: Thu, 25 Jul 2013 12:24:46 -0400

Greetings!

The autoconf macro

AC_CHECK_FUNC(profil, ,[AC_DEFINE(NO_PROFILE,1,[no profil system
call])])

produces the code

| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define VSSIZE 262144
| #define BDSSIZE 2048
| #define IHSSIZE 4096
| #define FRSSIZE 4096
| #define HOST_CPU "X86_64"
| #define HOST_KERNEL "DARWIN12.4.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_MALLOC_MALLOC_H 1
| #define HAVE_MALLOC_ZONE_MEMALIGN 1
| #define HAVE_UNISTD_H 1
| #define HZ 100
| #define HAVE_GMP_H 1
| #define LEADING_UNDERSCORE 1
| #define MP_LIMB_BYTES 8
| #define GMP 1
| #define HAVE_XDR 1
| #define HAVE_BUILTIN_CLEAR_CACHE 1
| #define SIZEOF_LONG 8
| #define PAGEWIDTH 12
| #define OBJ_ALIGNMENT 8
| #define OBJ_ALIGN __attribute__ ((aligned (8)))
| #define SIZEOF_CONTBLOCK 16
| #define CSTACK_ADDRESS 0x7fff5fffffff
| #define CSTACK_ALIGNMENT 32
| #define CSTACK_DIRECTION -1
| #define MEM_TOP 0x8000000000000000
| #define MEM_RANGE 0x4000000000000000
| #define IM_FIX_BASE 0x8000000000000000
| #define IM_FIX_LIM 0x4000000000000000
| #define HAVE_GETCWD 1
| #define HAVE_GETWD 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_SYS_SOCKIO_H 1
| #define HAVE_MATH_H 1
| #define HAVE_MATH_H 1
| #define HAVE_COMPLEX_H 1
| #define HAVE_COMPLEX_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_FLOAT_H 1
| #define HAVE_ISNORMAL 1
| #define HAVE_ISFINITE 1
| #define HAVE_READLINE_READLINE_H 1
| #define HAVE_READLINE 1
| #define HAVE_DECL_RL_COMPLETION_MATCHES 1
| #define HAVE_RL_COMPENTRY_FUNC_T 1
| #define HAVE_NSOCKET 1
| #define LISTEN_USE_FCNTL 1
| /* end confdefs.h.  */
| /* Define profil to an innocuous variant, in case <limits.h> declares profil.
|    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
| #define profil innocuous_profil
| 
| /* System header to define __stub macros and hopefully few prototypes,
|     which can conflict with char profil (); below.
|     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|     <limits.h> exists even on freestanding compilers.  */
| 
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| 
| #undef profil
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char profil ();
| /* The GNU C library defines this for functions which it implements
|     to always fail with ENOSYS.  Some functions are actually named
|     something starting with __ and the normal name is an alias.  */
| #if defined __stub_profil || defined __stub___profil
| choke me
| #endif
| 
| int
| main ()
| {
| return profil ();
|   ;
|   return 0;
| }

which does not compile onyour machine, with

configure:7860: gcc -o conftest -m64   -m64 -Wl,-headerpad,72  conftest.c  -lm 
>&5
Undefined symbols for architecture x86_64:
  "_profil", referenced from:
      _main in ccQzWbn0.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status


making configure think there is no profil, and it writes its own
prototype as you suggest.  But there is a prototype for profil in the
headers, and we get the compile time conflict.

I can hack around this, but perhaps you could try linking the program
above with different flags and see why the above fails.

If time does not permit, please so state and I'll hack.

Take care,
-- 
Camm Maguire                                        address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]