Open chriscamacho opened 11 years ago
Can you please run clang --version; uname -a and paste the output here?
certainly ...
chris@chris-LIFEBOOK-AH532 ~ $ clang --version Ubuntu clang version 3.2-1~exp9ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) Target: x86_64-pc-linux-gnu Thread model: posix chris@chris-LIFEBOOK-AH532 ~ $ uname -a Linux chris-LIFEBOOK-AH532 3.8.0-25-generic #37-Ubuntu SMP Thu Jun 6 20:47:07 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
shouldn't really matter but its Mint Linux (basically ubuntu with less junk)
I see. -arch is an Apple Clang option. We'll need to change that to -m or something for Linux. -L to ar is just me being sloppy. My archiver ignores -L, but yours don't. A matter of fixing the flags passed to ar when making the static library in the makefile.
isn't it --target?
got it compiled but don't know if my changes would break Apple build (who knew you were allowed to run compilers on Mac :o) ) - and I have yet to test !!!
anyhoo for a little while now for reasons I don't follow the order of libs is important, also you were missing math (-lm ie floor) and I also had to add in -lpthread on a few, so linking seems quite a bit different - so much for C being platform agnostic... ho hum
feel free to contact codifies using google's email service should you have any problems... (can you believe github users still can't message each other...)
diff --git a/Make.common b/Make.common index 2f0e25f..965fbd6 100644 --- a/Make.common +++ b/Make.common @@ -35,9 +35,9 @@ UpperCase = $(shell echo $(1) | tr a-z A-Z) # Compiler and Linker flags for all targets CFLAGS += -Wall -g -std=c99 -I$(INCLUDE_BUILD_PREFIX) \ - -arch $(TARGET_ARCH) + -target $(TARGET_ARCH) CXXFLAGS += -std=c++11 -fno-rtti -LDFLAGS += -arch $(TARGET_ARCH) +LDFLAGS += -m $(TARGET_ARCH) XXLDFLAGS += -lc++ -lstdc++ # Compiler and Linker flags for release and debug targets (e.g. make DEBUG=1) diff --git a/sol/Makefile b/sol/Makefile index 387e69b..3f17164 100644 --- a/sol/Makefile +++ b/sol/Makefile @@ -66,7 +66,7 @@ common_pre: $(project_id): common_pre lib$(project_id) libev $(main_program) $(main_program): $(main_objects) @mkdir -p $(dir $(main_program)) - $(LD) $(ld_flags) -lev -l$(project_id) -o $@ $^ + $(LD) $(ld_flags) -o $@ $^ -l$(project_id) -lev -lm # External dependency: libev libev: @@ -78,7 +78,7 @@ libev: lib$(project_id): common_pre $(headers_pub_export) $(static_library) $(static_library): $(objects) @mkdir -p $(dir $(static_library)) - $(AR) -rcL $@ $^ + $(AR) -rc $@ $^ # Generate LLVM IS code (.ll files) llvm_ir_pre: common_pre diff --git a/test/Makefile b/test/Makefile index b37a133..e4b9c45 100644 --- a/test/Makefile +++ b/test/Makefile @@ -44,7 +44,7 @@ common_pre: # Link and run tests (UP) $(bin_prefix)/%.c-up: $(object_dir)/%.up.o - $(LD) $(ld_flags) -lev -lsol -o $@ $^ + $(LD) $(ld_flags) -o $@ $^ -lsol -lev -lpthread -lm @printf "Running test: %s (UP) ... " $(patsubst %.c-up,%.c,$(@F)) @$@ >/dev/null @echo PASS @@ -52,7 +52,7 @@ $(bin_prefix)/%.c-up: $(object_dir)/%.up.o # Link and run tests (SMP) $(bin_prefix)/%.c-smp: $(object_dir)/%.smp.o - $(LD) $(ld_flags) -lev -lsol -lpthread -o $@ $^ + $(LD) $(ld_flags) -o $@ $^ -lsol -lev -lpthread -lm @printf "Running test: %s (SMP) ... " $(patsubst %.c-smp,%.c,$(@F)) @$@ >/dev/null @echo PASS
clang gives warnings about clang: warning: argument unused during compilation: '-arch x86_64'
and finally the make fails with ar: invalid option -- 'L'