Just to mention, the lipo extracted x86_64 produced the same FunctionNotFound. The re-compiled version was the only one that ran, albeit crashing.
Just in case anyone is curious, Here is my makefile:
CC = gcc
CFLAGS = -O -Wall
MACLIB = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
all: example1 example2a example2b example3a example3b example4
example1: example1.c smartdongle aes
$(CC) $(CFLAGS) /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices -o $@ $< smartdongle.o
example2a: example2a.c smartdongle
$(CC) $(CFLAGS) /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices -o $@ $< smartdongle.o
example2b: example2b.c smartdongle
$(CC) $(CFLAGS) /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices -o $@ $< smartdongle.o
example3a: example3a.c smartdongle aes
$(CC) $(CFLAGS) /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices -o $@ $< aes.o smartdongle.o
example3b: example3b.c smartdongle aes
$(CC) $(CFLAGS) /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices -o $@ $< aes.o smartdongle.o
example4: example4.c smartdongle
$(CC) $(CFLAGS) /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices -o $@ $< smartdongle.o
smartdongle: smartdongle.c
$(CC) $(CFLAGS) -c $<
aes: aes.c
$(CC) -c $<
# Test for AES
test:
$(CC) -DAES_TEST aes.c -o $@
- ./test
maclibrary:
#$(CC) $(CFLAGS) -m32 -fPIC -c $(MACLIB) smartdongle.c -o smartdongle.o
#$(CC) $(CFLAGS) -m32 -fPIC -c $(MACLIB) aes.c -o aes.o
#$(CC) -m32 $(MACLIB) smartdongle.o aes.o -o libsmartdongle_32.dylib -dynamiclib /opt/local/lib/libusb-legacy/libusb-legacy.a
$(CC) $(CFLAGS) -m64 -fPIC -c $(MACLIB) smartdongle.c -o smartdongle.o
$(CC) $(CFLAGS) -m64 -fPIC -c $(MACLIB) aes.c -o aes.o
$(CC) -m64 $(MACLIB) smartdongle.o aes.o -o libsmartdongle_64.dylib -dynamiclib /opt/local/lib/libusb-legacy/libusb-legacy.a -framework IOKit -framework CoreFoundation -framework CoreServices
#lipo -create libsmartdongle_32.dylib libsmartdongle_64.dylib -o libsmartdongle.dylib
#rm -f libsmartdongle_32.dylib
#rm -f libsmartdongle_64.dylib
linuxlibrary:
$(CC) $(CFLAGS) -m32 -fPIC -c smartdongle.c -o smartdongle.o
$(CC) $(CFLAGS) -m32 -fPIC -c aes.c -o aes.o
$(CC) -m32 smartdongle.o aes.o -o libsmartdongle_32.so -shared -lusb
$(CC) $(CFLAGS) -m64 -fPIC -c smartdongle.c -o smartdongle.o
$(CC) $(CFLAGS) -m64 -fPIC -c aes.c -o aes.o
$(CC) -m64 smartdongle.o aes.o -o libsmartdongle_64.so -shared -lusb
clean:
rm -f *.o *.so *.dylib example1 example2a example2b example3a example3b example4