On 21:08 Tue 19 May , Timur Tabi wrote: > I'm trying to build dtc on Mac OS X. The compilation seems to go > okay, but the linker dies. First, it says this: > > LD libfdt/libfdt.so > ld: unknown option: --version-script=libfdt/version.lds > collect2: ld returned 1 exit status > > A Google search suggested that I can just delete the --version-script > option. I did that, and now I get this error: > > LD libfdt/libfdt.so > ld: unknown option: -soname > collect2: ld returned 1 exit status > > This web page: http://lists.apple.com/archives/unix-porting/2003/Oct/msg00032.html > had some suggestions on how to fix that, so my Makefile now looks like > this: > > $(LIBFDT_lib): > @$(VECHO) LD $@ > $(CC) $(LDFLAGS) -fPIC -Wl,-dylib_install_name -Wl,$(notdir > $@) -shared -o $(LIBFDT_objdir)/libfdt-$(DTC_VERSION).so $^ > ln -s libfdt-$(DTC_VERSION).so $(LIBFDT_objdir)/libfdt.so > > But now I get this error: > > LD libfdt/libfdt.so > Undefined symbols: > "_main", referenced from: > start in crt1.10.5.o > ld: symbol(s) not found > collect2: ld returned 1 exit status > > So now I'm stuck. Has anyone tried this before? Can anyone tell me > how to fix this? -shared is incorrect on mac os it's -dynamiclib see attached patch Best Regards, J.