Skip to content

Instantly share code, notes, and snippets.

@cemmanouilidis
Created November 29, 2012 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemmanouilidis/4167458 to your computer and use it in GitHub Desktop.
Save cemmanouilidis/4167458 to your computer and use it in GitHub Desktop.
libobjc2 compile/build error on OSX Moutain Lion
###
# OSX version
###
charemma@das-macbook ~$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.8.2
BuildVersion: 12C3006
###
# clang version (installed using home-brew [brew install llvm --whith-clang])
###
charemma@das-macbook ~$ clang -v
clang version 3.1 (branches/release_31)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
###
# Try to build libobjc2
###
charemma@das-macbook ~gnustep/gnustep-libobjc2 (master)$ make debug=no SILENT= CC=clang
GNUmakefile:23: GNUstep found - building for install in the GNUstep filesystem.
echo Compiling `basename NSBlocks.m`...
Compiling NSBlocks.m...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -fobjc-exceptions -c NSBlocks.m -o NSBlocks.o
In file included from NSBlocks.m:2:
./class.h:285:14: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
return obj->isa;
^
1 warning generated.
echo Compiling `basename Protocol2.m`...
Compiling Protocol2.m...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -fobjc-exceptions -c Protocol2.m -o Protocol2.o
In file included from Protocol2.m:3:
./class.h:285:14: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
return obj->isa;
^
1 warning generated.
echo Compiling `basename abi_version.c`...
Compiling abi_version.c...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -c abi_version.c -o abi_version.o
echo Compiling `basename alias_table.c`...
Compiling alias_table.c...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -c alias_table.c -o alias_table.o
alias_table.c:123:21: warning: implicitly declaring library function 'strdup' with type 'char *(const char *)'
Alias newAlias = { strdup(alias), class };
^
alias_table.c:123:21: note: please include the header <string.h> or explicitly provide a declaration for 'strdup'
1 warning generated.
echo Compiling `basename arc.m`...
Compiling arc.m...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -fobjc-exceptions -c arc.m -o arc.o
In file included from arc.m:7:
./class.h:285:14: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
return obj->isa;
^
arc.m:169:19: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
Class cls = obj->isa;
^
arc.m:187:19: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
Class cls = obj->isa;
^
3 warnings generated.
echo Compiling `basename associate.m`...
Compiling associate.m...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -fobjc-exceptions -c associate.m -o associate.o
In file included from associate.m:9:
./class.h:285:14: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
return obj->isa;
^
associate.m:186:19: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
Class cls = obj->isa;
^
associate.m:225:47: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
Class hiddenClass = allocateHiddenClass(obj->isa);
^
associate.m:226:33: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
assert(!class_isMetaClass(obj->isa));
^
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
associate.m:235:7: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
obj->isa = hiddenClass;
^
associate.m:255:32: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
if (class_isMetaClass(object->isa))
^
associate.m:314:32: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
if (class_isMetaClass(object->isa))
^
associate.m:318:22: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
Class cls = object->isa;
^
associate.m:385:32: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
if (class_isMetaClass(object->isa))
^
associate.m:387:18: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
return object->isa;
^
associate.m:423:40: warning: direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass() [-Wdeprecated-objc-isa-usage]
id new = class_createInstance(object->isa, 0);
^
11 warnings generated.
echo Compiling `basename blocks_runtime.m`...
Compiling blocks_runtime.m...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -fobjc-exceptions -c blocks_runtime.m -o blocks_runtime.o
echo Compiling `basename block_to_imp.c`...
Compiling block_to_imp.c...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS -std=gnu99 -fPIC -fexceptions -c block_to_imp.c -o block_to_imp.o
block_to_imp.c:43:10: warning: implicit declaration of function 'asprintf' is invalid in C99 [-Wimplicit-function-declaration]
if (0 > asprintf(&tmpPattern, "%s/objc_trampolinesXXXXXXXXXXX", tmp))
^
block_to_imp.c:139:17: warning: implicitly declaring library function 'strdup' with type 'char *(const char *)'
char *buffer = strdup(block_getType_np(block));
^
block_to_imp.c:139:17: note: please include the header <string.h> or explicitly provide a declaration for 'strdup'
2 warnings generated.
echo Assembling `basename block_trampolines.S`...
Assembling block_trampolines.S...
clang -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS `if clang -v 2>&1| grep -q 'clang' ; then echo -no-integrated-as ; fi` -c block_trampolines.S -o block_trampolines.o
Assembler messages:
Fatal error: invalid listing option `r'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
make: *** [block_trampolines.o] Error 1
###
# pass option -v to clang as suggested in error message!
###
charemma@das-macbook ~gnustep/gnustep-libobjc2 (master)$ clang -v -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500 -D__BSD_VISIBLE=1 -D_BSD_SOURCE=1 -DNO_SELECTOR_MISMATCH_WARNINGS `if clang -v 2>&1| grep -q 'clang' ; then echo -no-integrated-as ; fi` -c block_trampolines.S -o block_trampolines.o
clang version 3.1 (branches/release_31)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
"/usr/local/Cellar/llvm/3.1/bin/clang" -cc1 -triple x86_64-apple-macosx10.8.0 -E -disable-free -main-file-name block_trampolines.S -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 134.9 -v -coverage-file /var/folders/j3/vs069q6s195czbk61xmj7_sm0000gn/T/block_trampolines-15fW57.s -resource-dir /usr/local/Cellar/llvm/3.1/bin/../lib/clang/3.1 -D TYPE_DEPENDENT_DISPATCH -D GNUSTEP -D __OBJC_RUNTIME_INTERNAL__=1 -D _XOPEN_SOURCE=500 -D __BSD_VISIBLE=1 -D _BSD_SOURCE=1 -D NO_SELECTOR_MISMATCH_WARNINGS -fmodule-cache-path /var/folders/j3/vs069q6s195czbk61xmj7_sm0000gn/T/clang-module-cache -fno-dwarf2-cfi-asm -fno-dwarf-directory-asm -fdebug-compilation-dir /Users/charemma/Development/gitagram-inc/libgnustep/gnustep-libobjc2 -ferror-limit 19 -fmessage-length 176 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/j3/vs069q6s195czbk61xmj7_sm0000gn/T/block_trampolines-15fW57.s -x assembler-with-cpp block_trampolines.S
clang -cc1 version 3.1 based upon LLVM 3.1 default target x86_64-apple-darwin12.2.1
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/Cellar/llvm/3.1/bin/../lib/clang/3.1/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
"/usr/local/bin/as" -arch x86_64 -force_cpusubtype_ALL -o block_trampolines.o /var/folders/j3/vs069q6s195czbk61xmj7_sm0000gn/T/block_trampolines-15fW57.s
Assembler messages:
Fatal error: invalid listing option `r'
clang: error: assembler command failed with exit code 1 (use -v to see invocation)
####
# clang tries to compile with otpion -arch x86_64, which is not available
# for command as on my machine
####
"/usr/local/bin/as" -arch x86_64 -force_cpusubtype_ALL -o block_trampolines.o
Assembler messages:
Fatal error: invalid listing option `r'
###
# print binutils version
###
charemma@das-macbook ~$ as --version
GNU assembler (GNU Binutils) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `'.
###
# print available options for command as (option -arch not availble)
###
charemma@das-macbook ~$ as --help
Usage: as [option...] [asmfile...]
Options:
-a[sub-option...] turn on listings
Sub-options [default hls]:
c omit false conditionals
d omit debugging directives
g include general info
h include high-level source
l include assembly
m include macro expansions
n omit forms processing
s include symbols
=FILE list to FILE (must be last sub-option)
--alternate initially turn on alternate macro syntax
--compress-debug-sections
compress DWARF debug sections using zlib
--nocompress-debug-sections
don't compress DWARF debug sections
-D produce assembler debugging messages
--debug-prefix-map OLD=NEW
map OLD to NEW in debug information
--defsym SYM=VAL define symbol SYM to given value
-f skip whitespace and comment preprocessing
-g --gen-debug generate debugging information
--gstabs generate STABS debugging information
--gstabs+ generate STABS debug info with GNU extensions
--gdwarf-2 generate DWARF2 debugging information
--hash-size=<value> set the hash table size close to <value>
--help show this message and exit
--target-help show target specific options
-I DIR add DIR to search list for .include directives
-J don't warn about signed overflow
-K warn when differences altered for long displacements
-L,--keep-locals keep local symbols (e.g. starting with `L')
-M,--mri assemble in MRI compatibility mode
--MD FILE write dependency information in FILE (default none)
-nocpp ignored
-o OBJFILE name the object-file output OBJFILE (default a.out)
-R fold data section into text section
--reduce-memory-overheads
prefer smaller memory use at the cost of longer
assembly times
--statistics print various measured statistics from execution
--strip-local-absolute strip local absolute symbols
--traditional-format Use same format as native assembler when possible
--version print assembler version number and exit
-W --no-warn suppress warnings
--warn don't suppress warnings
--fatal-warnings treat warnings as errors
-w ignored
-X ignored
-Z generate object file even after errors
--listing-lhs-width set the width in words of the output data column of
the listing
--listing-lhs-width2 set the width in words of the continuation lines
of the output data column; ignored if smaller than
the width of the first line
--listing-rhs-width set the max width in characters of the lines from
the source file
--listing-cont-lines set the maximum number of continuation lines used
for the output data column of the listing
@FILE read options from FILE
-n Do not optimize code alignment
-q quieten some warnings
--divide ignored
-march=CPU[,+EXTENSION...]
generate code for CPU and EXTENSION, CPU is one of:
generic32, generic64, i386, i486, i586, i686,
pentium, pentiumpro, pentiumii, pentiumiii, pentium4,
prescott, nocona, core, core2, corei7, l1om, k1om,
k6, k6_2, athlon, opteron, k8, amdfam10, bdver1,
bdver2
EXTENSION is combination of:
8087, 287, 387, no87, mmx, nommx, sse, sse2, sse3,
ssse3, sse4.1, sse4.2, sse4, nosse, avx, avx2, noavx,
vmx, smx, xsave, xsaveopt, aes, pclmul, fsgsbase,
rdrnd, f16c, bmi2, fma, fma4, xop, lwp, movbe, ept,
lzcnt, invpcid, clflush, nop, syscall, rdtscp, 3dnow,
3dnowa, padlock, svme, sse4a, abm, bmi, tbm
-mtune=CPU optimize for CPU, CPU is one of:
generic32, generic64, i8086, i186, i286, i386, i486,
i586, i686, pentium, pentiumpro, pentiumii,
pentiumiii, pentium4, prescott, nocona, core, core2,
corei7, l1om, k1om, k6, k6_2, athlon, opteron, k8,
amdfam10, bdver1, bdver2
-msse2avx encode SSE instructions with VEX prefix
-msse-check=[none|error|warning]
check SSE instructions
-mavxscalar=[128|256] encode scalar AVX instructions with specific vector
length
-mmnemonic=[att|intel] use AT&T/Intel mnemonic
-msyntax=[att|intel] use AT&T/Intel syntax
-mindex-reg support pseudo index registers
-mnaked-reg don't require `%' prefix for registers
-mold-gcc support old (<= 2.8.1) versions of gcc
Report bugs to <http://www.sourceware.org/bugzilla/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment