-
-
Save kisielk/7032410 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kamils-MacBook-Air:tmp kamil$ clang -v | |
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) | |
Target: x86_64-apple-darwin12.5.0 | |
Thread model: posix | |
Kamils-MacBook-Air:tmp kamil$ go build -x | |
WORK=/var/folders/l7/xpn_29dn36qd97kgm79_8dg00000gn/T/go-build207250261 | |
mkdir -p $WORK/_/Users/kamil/tmp/_obj/ | |
mkdir -p $WORK/_/Users/kamil/ | |
cd /Users/kamil/tmp | |
/Users/kamil/go.tip/pkg/tool/darwin_amd64/cgo -objdir $WORK/_/Users/kamil/tmp/_obj/ -- -I $WORK/_/Users/kamil/tmp/_obj/ foo.go | |
/Users/kamil/go.tip/pkg/tool/darwin_amd64/6c -F -V -w -I $WORK/_/Users/kamil/tmp/_obj/ -I /Users/kamil/go.tip/pkg/darwin_amd64 -o $WORK/_/Users/kamil/tmp/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/_/Users/kamil/tmp/_obj/_cgo_defun.c | |
clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -print-libgcc-file-name | |
clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/_/Users/kamil/tmp/_obj/ -o $WORK/_/Users/kamil/tmp/_obj/_cgo_main.o -c $WORK/_/Users/kamil/tmp/_obj/_cgo_main.c | |
clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/_/Users/kamil/tmp/_obj/ -o $WORK/_/Users/kamil/tmp/_obj/_cgo_export.o -c $WORK/_/Users/kamil/tmp/_obj/_cgo_export.c | |
clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -I $WORK/_/Users/kamil/tmp/_obj/ -o $WORK/_/Users/kamil/tmp/_obj/foo.cgo2.o -c $WORK/_/Users/kamil/tmp/_obj/foo.cgo2.c | |
clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -o $WORK/_/Users/kamil/tmp/_obj/_cgo_.o $WORK/_/Users/kamil/tmp/_obj/_cgo_main.o $WORK/_/Users/kamil/tmp/_obj/_cgo_export.o $WORK/_/Users/kamil/tmp/_obj/foo.cgo2.o | |
/Users/kamil/go.tip/pkg/tool/darwin_amd64/cgo -objdir $WORK/_/Users/kamil/tmp/_obj/ -dynimport $WORK/_/Users/kamil/tmp/_obj/_cgo_.o -dynout $WORK/_/Users/kamil/tmp/_obj/_cgo_import.c | |
/Users/kamil/go.tip/pkg/tool/darwin_amd64/6c -F -V -w -I $WORK/_/Users/kamil/tmp/_obj/ -I /Users/kamil/go.tip/pkg/darwin_amd64 -o $WORK/_/Users/kamil/tmp/_obj/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/_/Users/kamil/tmp/_obj/_cgo_import.c | |
clang -I . -g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fno-common -o $WORK/_/Users/kamil/tmp/_obj/_all.o $WORK/_/Users/kamil/tmp/_obj/_cgo_export.o $WORK/_/Users/kamil/tmp/_obj/foo.cgo2.o -Wl,-r -nostdlib | |
/Users/kamil/go.tip/pkg/tool/darwin_amd64/6g -o $WORK/_/Users/kamil/tmp/_obj/_go_.6 -p _/Users/kamil/tmp -D _/Users/kamil/tmp -I $WORK $WORK/_/Users/kamil/tmp/_obj/_cgo_gotypes.go $WORK/_/Users/kamil/tmp/_obj/foo.cgo1.go | |
/Users/kamil/go.tip/pkg/tool/darwin_amd64/pack grcP $WORK $WORK/_/Users/kamil/tmp.a $WORK/_/Users/kamil/tmp/_obj/_go_.6 $WORK/_/Users/kamil/tmp/_obj/_cgo_import.6 $WORK/_/Users/kamil/tmp/_obj/_cgo_defun.6 $WORK/_/Users/kamil/tmp/_obj/_all.o | |
Kamils-MacBook-Air:tmp kamil$ go tool cgo -debug-gcc foo.go | |
$ clang -E -dM -xc -m64 - <<EOF | |
#line 3 "/Users/kamil/tmp/foo.go" | |
void hrrr() {} | |
#define hrr hrrr | |
#define saywat hrr | |
#include <sys/types.h> /* for size_t below */ | |
/* Define intgo when compiling with GCC. */ | |
#ifdef __PTRDIFF_TYPE__ | |
typedef __PTRDIFF_TYPE__ intgo; | |
#elif defined(_LP64) | |
typedef long long intgo; | |
#else | |
typedef int intgo; | |
#endif | |
typedef struct { char *p; intgo n; } _GoString_; | |
typedef struct { char *p; intgo n; intgo c; } _GoBytes_; | |
_GoString_ GoString(char *p); | |
_GoString_ GoStringN(char *p, int l); | |
_GoBytes_ GoBytes(void *p, int n); | |
char *CString(_GoString_); | |
void *_CMalloc(size_t); | |
EOF | |
#define BIG_ENDIAN __DARWIN_BIG_ENDIAN | |
#define BYTE_ORDER __DARWIN_BYTE_ORDER | |
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr))) | |
#define FD_CLR(n,p) __DARWIN_FD_CLR(n, p) | |
#define FD_COPY(f,t) __DARWIN_FD_COPY(f, t) | |
#define FD_ISSET(n,p) __DARWIN_FD_ISSET(n, p) | |
#define FD_SET(n,p) __DARWIN_FD_SET(n, p) | |
#define FD_SETSIZE __DARWIN_FD_SETSIZE | |
#define FD_ZERO(p) __DARWIN_FD_ZERO(p) | |
#define HTONL(x) (x) = htonl((__uint32_t)x) | |
#define HTONS(x) (x) = htons((__uint16_t)x) | |
#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN | |
#define NBBY __DARWIN_NBBY | |
#define NFDBITS __DARWIN_NFDBITS | |
#define NTOHL(x) (x) = ntohl((__uint32_t)x) | |
#define NTOHS(x) (x) = ntohs((__uint16_t)x) | |
#define OBJC_NEW_PROPERTIES 1 | |
#define PDP_ENDIAN __DARWIN_PDP_ENDIAN | |
#define USER_ADDR_NULL ((user_addr_t) 0) | |
#define _BLKCNT_T | |
#define _BLKSIZE_T | |
#define _BSD_I386__TYPES_H_ | |
#define _BSD_MACHINE_ENDIAN_H_ | |
#define _BSD_MACHINE_TYPES_H_ | |
#define _BSD_MACHINE__TYPES_H_ | |
#define _CDEFS_H_ | |
#define _CLOCK_T | |
#define _DARWIN_FEATURE_64_BIT_INODE 1 | |
#define _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE 1 | |
#define _DARWIN_FEATURE_UNIX_CONFORMANCE 3 | |
#define _DEV_T | |
#define _FD_SET | |
#define _FSBLKCNT_T | |
#define _FSFILCNT_T | |
#define _GID_T | |
#define _I386__ENDIAN_H_ | |
#define _ID_T | |
#define _INO64_T | |
#define _INO_T | |
#define _INT16_T | |
#define _INT32_T | |
#define _INT64_T | |
#define _INT8_T | |
#define _INTPTR_T | |
#define _IN_ADDR_T | |
#define _IN_PORT_T | |
#define _KEY_T | |
#define _LP64 1 | |
#define _MACHTYPES_H_ | |
#define _MODE_T | |
#define _NLINK_T | |
#define _OFF_T | |
#define _OS__OSBYTEORDERI386_H | |
#define _OS__OSBYTEORDER_H | |
#define _PID_T | |
#define _PTHREAD_ATTR_T | |
#define _PTHREAD_CONDATTR_T | |
#define _PTHREAD_COND_T | |
#define _PTHREAD_KEY_T | |
#define _PTHREAD_MUTEXATTR_T | |
#define _PTHREAD_MUTEX_T | |
#define _PTHREAD_ONCE_T | |
#define _PTHREAD_RWLOCKATTR_T | |
#define _PTHREAD_RWLOCK_T | |
#define _PTHREAD_T | |
#define _QUAD_HIGHWORD 1 | |
#define _QUAD_LOWWORD 0 | |
#define _SIZE_T | |
#define _SSIZE_T | |
#define _SUSECONDS_T | |
#define _SYS_TYPES_H_ | |
#define _SYS__ENDIAN_H_ | |
#define _SYS__TYPES_H_ | |
#define _TIME_T | |
#define _UID_T | |
#define _UINTPTR_T | |
#define _USECONDS_T | |
#define _U_LONG | |
#define __APPLE_API_EVOLVING | |
#define __APPLE_API_OBSOLETE | |
#define __APPLE_API_PRIVATE | |
#define __APPLE_API_STABLE | |
#define __APPLE_API_STANDARD | |
#define __APPLE_API_UNSTABLE | |
#define __APPLE_CC__ 5621 | |
#define __APPLE__ 1 | |
#define __ATOMIC_ACQUIRE 2 | |
#define __ATOMIC_ACQ_REL 4 | |
#define __ATOMIC_CONSUME 1 | |
#define __ATOMIC_RELAXED 0 | |
#define __ATOMIC_RELEASE 3 | |
#define __ATOMIC_SEQ_CST 5 | |
#define __BEGIN_DECLS | |
#define __BLOCKS__ 1 | |
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ | |
#define __CAST_AWAY_QUALIFIER(variable,qualifier,type) (type) (long)(variable) | |
#define __CHAR16_TYPE__ unsigned short | |
#define __CHAR32_TYPE__ unsigned int | |
#define __CHAR_BIT__ 8 | |
#define __CONCAT(x,y) x ## y | |
#define __CONSTANT_CFSTRINGS__ 1 | |
#define __COPYRIGHT(s) __IDSTRING(copyright,s) | |
#define __DARWIN_1050(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050) | |
#define __DARWIN_1050ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_UNIX03) | |
#define __DARWIN_1050ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03) | |
#define __DARWIN_1050ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03) | |
#define __DARWIN_1050INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_1050 __DARWIN_SUF_64_BIT_INO_T) | |
#define __DARWIN_64_BIT_INO_T 1 | |
#define __DARWIN_ALIAS(sym) __asm("_" __STRING(sym) __DARWIN_SUF_UNIX03) | |
#define __DARWIN_ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03) | |
#define __DARWIN_ALIAS_I(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03) | |
#define __DARWIN_ALIAS_STARTING(_mac,_iphone,x) __DARWIN_ALIAS_STARTING_MAC_##_mac(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_0(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_1(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_2_2(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_0(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_1(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_3_2(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_0(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_1(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_2(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_3(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_5_0(x) | |
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_5_1(x) | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_1(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_2(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_3(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_4(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_5(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_6(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_7(x) x | |
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_8(x) x | |
#define __DARWIN_BIG_ENDIAN 4321 | |
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN | |
#define __DARWIN_C_ANSI 010000L | |
#define __DARWIN_C_FULL 900000L | |
#define __DARWIN_C_LEVEL __DARWIN_C_FULL | |
#define __DARWIN_EXTSN(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN) | |
#define __DARWIN_EXTSN_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_EXTSN __DARWIN_SUF_NON_CANCELABLE) | |
#define __DARWIN_FD_CLR(n,p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] &= ~(1<<(__fd % __DARWIN_NFDBITS))); } while(0) | |
#define __DARWIN_FD_COPY(f,t) bcopy(f, t, sizeof(*(f))) | |
#define __DARWIN_FD_ISSET(n,p) __darwin_fd_isset((n), (p)) | |
#define __DARWIN_FD_SET(n,p) do { int __fd = (n); ((p)->fds_bits[__fd/__DARWIN_NFDBITS] |= (1<<(__fd % __DARWIN_NFDBITS))); } while(0) | |
#define __DARWIN_FD_SETSIZE 1024 | |
#define __DARWIN_FD_ZERO(p) __builtin_bzero(p, sizeof(*(p))) | |
#define __DARWIN_INODE64(sym) __asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T) | |
#define __DARWIN_LITTLE_ENDIAN 1234 | |
#define __DARWIN_NBBY 8 | |
#define __DARWIN_NFDBITS (sizeof(__int32_t) * __DARWIN_NBBY) | |
#define __DARWIN_NON_CANCELABLE 0 | |
#define __DARWIN_NO_LONG_LONG (defined(__STRICT_ANSI__) && (__STDC_VERSION__-0 < 199901L) && !defined(__GNUG__)) | |
#define __DARWIN_NULL ((void *)0) | |
#define __DARWIN_ONLY_64_BIT_INO_T 0 | |
#define __DARWIN_ONLY_UNIX_CONFORMANCE 1 | |
#define __DARWIN_ONLY_VERS_1050 0 | |
#define __DARWIN_OSSwapConstInt16(x) ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | (((__uint16_t)(x) & 0x00ff) << 8))) | |
#define __DARWIN_OSSwapConstInt32(x) ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | (((__uint32_t)(x) & 0x00ff0000) >> 8) | (((__uint32_t)(x) & 0x0000ff00) << 8) | (((__uint32_t)(x) & 0x000000ff) << 24))) | |
#define __DARWIN_OSSwapConstInt64(x) ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | (((__uint64_t)(x) & 0x000000ff00000000ULL) >> 8) | (((__uint64_t)(x) & 0x00000000ff000000ULL) << 8) | (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | (((__uint64_t)(x) & 0x00000000000000ffULL) << 56))) | |
#define __DARWIN_OSSwapInt16(x) ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x))) | |
#define __DARWIN_OSSwapInt32(x) (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x)) | |
#define __DARWIN_OSSwapInt64(x) (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x)) | |
#define __DARWIN_OS_INLINE static inline | |
#define __DARWIN_PDP_ENDIAN 3412 | |
#define __DARWIN_SUF_1050 "$1050" | |
#define __DARWIN_SUF_64_BIT_INO_T "$INODE64" | |
#define __DARWIN_SUF_EXTSN "$DARWIN_EXTSN" | |
#define __DARWIN_SUF_NON_CANCELABLE | |
#define __DARWIN_SUF_UNIX03 | |
#define __DARWIN_UNIX03 1 | |
#define __DARWIN_VERS_1050 1 | |
#define __DARWIN_howmany(x,y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1)) | |
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324 | |
#define __DBL_DIG__ 15 | |
#define __DBL_EPSILON__ 2.2204460492503131e-16 | |
#define __DBL_HAS_DENORM__ 1 | |
#define __DBL_HAS_INFINITY__ 1 | |
#define __DBL_HAS_QUIET_NAN__ 1 | |
#define __DBL_MANT_DIG__ 53 | |
#define __DBL_MAX_10_EXP__ 308 | |
#define __DBL_MAX_EXP__ 1024 | |
#define __DBL_MAX__ 1.7976931348623157e+308 | |
#define __DBL_MIN_10_EXP__ (-307) | |
#define __DBL_MIN_EXP__ (-1021) | |
#define __DBL_MIN__ 2.2250738585072014e-308 | |
#define __DECIMAL_DIG__ 21 | |
#define __DYNAMIC__ 1 | |
#define __END_DECLS | |
#define __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 1080 | |
#define __FBSDID(s) | |
#define __FINITE_MATH_ONLY__ 0 | |
#define __FLT_DENORM_MIN__ 1.40129846e-45F | |
#define __FLT_DIG__ 6 | |
#define __FLT_EPSILON__ 1.19209290e-7F | |
#define __FLT_EVAL_METHOD__ 0 | |
#define __FLT_HAS_DENORM__ 1 | |
#define __FLT_HAS_INFINITY__ 1 | |
#define __FLT_HAS_QUIET_NAN__ 1 | |
#define __FLT_MANT_DIG__ 24 | |
#define __FLT_MAX_10_EXP__ 38 | |
#define __FLT_MAX_EXP__ 128 | |
#define __FLT_MAX__ 3.40282347e+38F | |
#define __FLT_MIN_10_EXP__ (-37) | |
#define __FLT_MIN_EXP__ (-125) | |
#define __FLT_MIN__ 1.17549435e-38F | |
#define __FLT_RADIX__ 2 | |
#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 | |
#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 | |
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 | |
#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 | |
#define __GCC_ATOMIC_INT_LOCK_FREE 2 | |
#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 | |
#define __GCC_ATOMIC_LONG_LOCK_FREE 2 | |
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 | |
#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 | |
#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 | |
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 | |
#define __GNUC_MINOR__ 2 | |
#define __GNUC_PATCHLEVEL__ 1 | |
#define __GNUC_STDC_INLINE__ 1 | |
#define __GNUC__ 4 | |
#define __GXX_ABI_VERSION 1002 | |
#define __GXX_RTTI 1 | |
#define __IDSTRING(name,string) static const char name[] __used = string | |
#define __INT16_TYPE__ short | |
#define __INT32_TYPE__ int | |
#define __INT64_C_SUFFIX__ LL | |
#define __INT64_TYPE__ long long int | |
#define __INT8_TYPE__ char | |
#define __INTMAX_MAX__ 9223372036854775807L | |
#define __INTMAX_TYPE__ long int | |
#define __INTMAX_WIDTH__ 64 | |
#define __INTPTR_TYPE__ long int | |
#define __INTPTR_WIDTH__ 64 | |
#define __INT_MAX__ 2147483647 | |
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L | |
#define __LDBL_DIG__ 18 | |
#define __LDBL_EPSILON__ 1.08420217248550443401e-19L | |
#define __LDBL_HAS_DENORM__ 1 | |
#define __LDBL_HAS_INFINITY__ 1 | |
#define __LDBL_HAS_QUIET_NAN__ 1 | |
#define __LDBL_MANT_DIG__ 64 | |
#define __LDBL_MAX_10_EXP__ 4932 | |
#define __LDBL_MAX_EXP__ 16384 | |
#define __LDBL_MAX__ 1.18973149535723176502e+4932L | |
#define __LDBL_MIN_10_EXP__ (-4931) | |
#define __LDBL_MIN_EXP__ (-16381) | |
#define __LDBL_MIN__ 3.36210314311209350626e-4932L | |
#define __LITTLE_ENDIAN__ 1 | |
#define __LONG_LONG_MAX__ 9223372036854775807LL | |
#define __LONG_MAX__ 9223372036854775807L | |
#define __LP64__ 1 | |
#define __MACH__ 1 | |
#define __MMX__ 1 | |
#define __NO_INLINE__ 1 | |
#define __NO_MATH_INLINES 1 | |
#define __ORDER_BIG_ENDIAN__ 4321 | |
#define __ORDER_LITTLE_ENDIAN__ 1234 | |
#define __ORDER_PDP_ENDIAN__ 3412 | |
#define __P(protos) protos | |
#define __PIC__ 2 | |
#define __POINTER_WIDTH__ 64 | |
#define __POSIX_C_DEPRECATED(ver) ___POSIX_C_DEPRECATED_STARTING_##ver | |
#define __PRAGMA_REDEFINE_EXTNAME 1 | |
#define __PROJECT_VERSION(s) __IDSTRING(project_version,s) | |
#define __PTHREAD_ATTR_SIZE__ 56 | |
#define __PTHREAD_CONDATTR_SIZE__ 8 | |
#define __PTHREAD_COND_SIZE__ 40 | |
#define __PTHREAD_MUTEXATTR_SIZE__ 8 | |
#define __PTHREAD_MUTEX_SIZE__ 56 | |
#define __PTHREAD_ONCE_SIZE__ 8 | |
#define __PTHREAD_RWLOCKATTR_SIZE__ 16 | |
#define __PTHREAD_RWLOCK_SIZE__ 192 | |
#define __PTHREAD_SIZE__ 1168 | |
#define __PTRDIFF_TYPE__ long int | |
#define __PTRDIFF_WIDTH__ 64 | |
#define __RCSID(s) __IDSTRING(rcsid,s) | |
#define __REGISTER_PREFIX__ | |
#define __SCCSID(s) __IDSTRING(sccsid,s) | |
#define __SCHAR_MAX__ 127 | |
#define __SHRT_MAX__ 32767 | |
#define __SIG_ATOMIC_WIDTH__ 32 | |
#define __SIZEOF_DOUBLE__ 8 | |
#define __SIZEOF_FLOAT__ 4 | |
#define __SIZEOF_INT128__ 16 | |
#define __SIZEOF_INT__ 4 | |
#define __SIZEOF_LONG_DOUBLE__ 16 | |
#define __SIZEOF_LONG_LONG__ 8 | |
#define __SIZEOF_LONG__ 8 | |
#define __SIZEOF_POINTER__ 8 | |
#define __SIZEOF_PTRDIFF_T__ 8 | |
#define __SIZEOF_SHORT__ 2 | |
#define __SIZEOF_SIZE_T__ 8 | |
#define __SIZEOF_WCHAR_T__ 4 | |
#define __SIZEOF_WINT_T__ 4 | |
#define __SIZE_TYPE__ long unsigned int | |
#define __SIZE_WIDTH__ 64 | |
#define __SSE2_MATH__ 1 | |
#define __SSE2__ 1 | |
#define __SSE3__ 1 | |
#define __SSE_MATH__ 1 | |
#define __SSE__ 1 | |
#define __SSP__ 1 | |
#define __SSSE3__ 1 | |
#define __STDC_HOSTED__ 1 | |
#define __STDC_VERSION__ 199901L | |
#define __STDC__ 1 | |
#define __STRING(x) #x | |
#define __SYS_APPLEAPIOPTS_H__ | |
#define __UINTMAX_TYPE__ long unsigned int | |
#define __USER_LABEL_PREFIX__ _ | |
#define __VERSION__ "4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)" | |
#define __WCHAR_MAX__ 2147483647 | |
#define __WCHAR_TYPE__ int | |
#define __WCHAR_WIDTH__ 32 | |
#define __WINT_TYPE__ int | |
#define __WINT_WIDTH__ 32 | |
#define ___POSIX_C_DEPRECATED_STARTING_198808L | |
#define ___POSIX_C_DEPRECATED_STARTING_199009L | |
#define ___POSIX_C_DEPRECATED_STARTING_199209L | |
#define ___POSIX_C_DEPRECATED_STARTING_199309L | |
#define ___POSIX_C_DEPRECATED_STARTING_199506L | |
#define ___POSIX_C_DEPRECATED_STARTING_200112L | |
#define ___POSIX_C_DEPRECATED_STARTING_200809L | |
#define __amd64 1 | |
#define __amd64__ 1 | |
#define __apple_build_version__ 4250028 | |
#define __block __attribute__((__blocks__(byref))) | |
#define __clang__ 1 | |
#define __clang_major__ 4 | |
#define __clang_minor__ 2 | |
#define __clang_patchlevel__ 0 | |
#define __clang_version__ "4.2 (clang-425.0.28)" | |
#define __const const | |
#define __core2 1 | |
#define __core2__ 1 | |
#define __dead | |
#define __dead2 __attribute__((noreturn)) | |
#define __deprecated __attribute__((deprecated)) | |
#define __llvm__ 1 | |
#define __offsetof(type,field) ((size_t)(&((type *)0)->field)) | |
#define __pic__ 2 | |
#define __printflike(fmtarg,firstvararg) __attribute__((__format__ (__printf__, fmtarg, firstvararg))) | |
#define __pure | |
#define __pure2 __attribute__((const)) | |
#define __restrict restrict | |
#define __scanflike(fmtarg,firstvararg) __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) | |
#define __signed signed | |
#define __strong | |
#define __tune_core2__ 1 | |
#define __unavailable __attribute__((unavailable)) | |
#define __unsafe_unretained | |
#define __unused __attribute__((unused)) | |
#define __used __attribute__((used)) | |
#define __volatile volatile | |
#define __weak __attribute__((objc_gc(weak))) | |
#define __x86_64 1 | |
#define __x86_64__ 1 | |
#define howmany(x,y) __DARWIN_howmany(x, y) | |
#define hrr hrrr | |
#define htonl(x) __DARWIN_OSSwapInt32(x) | |
#define htons(x) __DARWIN_OSSwapInt16(x) | |
#define major(x) ((int32_t)(((u_int32_t)(x) >> 24) & 0xff)) | |
#define makedev(x,y) ((dev_t)(((x) << 24) | (y))) | |
#define minor(x) ((int32_t)((x) & 0xffffff)) | |
#define ntohl(x) __DARWIN_OSSwapInt32(x) | |
#define ntohs(x) __DARWIN_OSSwapInt16(x) | |
#define saywat hrr | |
$ clang -Wall -Werror -o_obj/_cgo_.o -gdwarf-2 -fno-eliminate-unused-debug-types -c -xc -ferror-limit=0 -Wno-unknown-warning-option -Wno-unneeded-internal-declaration -Wno-unused-function -Qunused-arguments -fno-builtin -m64 - -Wsystem-headers <<EOF | |
#line 3 "/Users/kamil/tmp/foo.go" | |
void hrrr() {} | |
#define hrr hrrr | |
#define saywat hrr | |
#include <sys/types.h> /* for size_t below */ | |
/* Define intgo when compiling with GCC. */ | |
#ifdef __PTRDIFF_TYPE__ | |
typedef __PTRDIFF_TYPE__ intgo; | |
#elif defined(_LP64) | |
typedef long long intgo; | |
#else | |
typedef int intgo; | |
#endif | |
typedef struct { char *p; intgo n; } _GoString_; | |
typedef struct { char *p; intgo n; intgo c; } _GoBytes_; | |
_GoString_ GoString(char *p); | |
_GoString_ GoStringN(char *p, int l); | |
_GoBytes_ GoBytes(void *p, int n); | |
char *CString(_GoString_); | |
void *_CMalloc(size_t); | |
void __cgo__f__(void) { | |
1; | |
#line 1 "cgo-test" | |
hrr; /* #0 */ | |
enum { _cgo_enum_0 = hrr }; /* #0 */ | |
} | |
EOF | |
cgo-test:2:22: error: expression is not an integer constant expression | |
enum { _cgo_enum_0 = hrr }; /* #0 */ | |
^~~ | |
/Users/kamil/tmp/foo.go:4:14: note: expanded from macro 'hrr' | |
#define hrr hrrr | |
^~~~ | |
/Users/kamil/tmp/foo.go:27:1: error: expression result unused [-Werror,-Wunused-value] | |
1; | |
^ | |
cgo-test:1:1: error: expression result unused [-Werror,-Wunused-value] | |
hrr; /* #0 */ | |
^~~ | |
/Users/kamil/tmp/foo.go:4:14: note: expanded from macro 'hrr' | |
#define hrr hrrr | |
^~~~ | |
3 errors generated. | |
$ clang -Wall -Werror -o_obj/_cgo_.o -gdwarf-2 -fno-eliminate-unused-debug-types -c -xc -ferror-limit=0 -Wno-unknown-warning-option -Wno-unneeded-internal-declaration -Wno-unused-function -Qunused-arguments -fno-builtin -m64 - <<EOF | |
#line 3 "/Users/kamil/tmp/foo.go" | |
void hrrr() {} | |
#define hrr hrrr | |
#define saywat hrr | |
#include <sys/types.h> /* for size_t below */ | |
/* Define intgo when compiling with GCC. */ | |
#ifdef __PTRDIFF_TYPE__ | |
typedef __PTRDIFF_TYPE__ intgo; | |
#elif defined(_LP64) | |
typedef long long intgo; | |
#else | |
typedef int intgo; | |
#endif | |
typedef struct { char *p; intgo n; } _GoString_; | |
typedef struct { char *p; intgo n; intgo c; } _GoBytes_; | |
_GoString_ GoString(char *p); | |
_GoString_ GoStringN(char *p, int l); | |
_GoBytes_ GoBytes(void *p, int n); | |
char *CString(_GoString_); | |
void *_CMalloc(size_t); | |
typeof(hrr) *__cgo__0; | |
long long __cgodebug_data[] = { | |
0, | |
1 | |
}; | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat main.go | |
package wat | |
// void hrrr() {} | |
// #define hrr hrrr | |
// #define saywat hrr | |
import "C" | |
func uhh() { | |
C.saywat() | |
} | |
$ go build -x | |
WORK=/var/folders/h8/dwmtrvys2svf0zc_fn7b8rgc0000gn/T/go-build079394059 | |
mkdir -p $WORK/_/Users/jamesgray/proj/term4k/wat/_obj/ | |
mkdir -p $WORK/_/Users/jamesgray/proj/term4k/ | |
cd /Users/jamesgray/proj/term4k/wat | |
/Users/jamesgray/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/_/Users/jamesgray/proj/term4k/wat/_obj/ -- -I $WORK/_/Users/jamesgray/proj/term4k/wat/_obj/ main.go | |
# _/Users/jamesgray/proj/term4k/wat | |
could not determine kind of name for C.saywat | |
$ clang -v | |
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn) | |
Target: x86_64-apple-darwin12.5.0 | |
Thread model: posix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment