1

The newest llvm-clang has been installed (I build the source under my ~/ directory).

I was trying installing the standard library libc++. After successfully executed

svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx

I ran

./buildit

under ~/llvm-clang/libcxx/lib

However, I got an error:

+ clang algorithm.o any.o bind.o chrono.o condition_variable.o debug.o exception.o future.o hash.o ios.o iostream.o locale.o memory.o mutex.o new.o optional.o random.o regex.o shared_mutex.o stdexcept.o string.o strstream.o system_error.o thread.o typeinfo.o utility.o valarray.o -fPIC -o libc++.so.1.0 -shared -nodefaultlibs -Wl,-soname,libc++.so.1 -lpthread -lrt -lc -lstdc++ -nostdinc++ -std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wstrict-aliasing=2 -Wstrict-overflow=4
clang: warning: argument unused during compilation: '-nostdinc++'
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I solve it?

jinglei
  • 3,269
  • 11
  • 27
  • 46

1 Answers1

0

The OSX linker does not know the -soname option. There are several workarounds (using install_name, delete makefiles,...) see this What is the 'soname' option for building shared libraries for? and this "ld: unknown option: -soname" on OS X

Community
  • 1
  • 1
ralf htp
  • 9,149
  • 4
  • 22
  • 34
  • Thanks. I went through the two references and I think using `install_name` switch might solve the problem. However, I'm wondering how to do that? As the commands are executed automatically, how can I change the flag `-soname` to `-install_name`? – jinglei Apr 09 '16 at 10:42
  • i do not know MAC OS, on linux there is a makefile (or a file with the build instructions of another builder) in the source code and with the make command you invoke it. In this makefile are also the linker options, so you have to find the makefile and change it. – ralf htp Apr 09 '16 at 11:14