theos / sdks

Patched sdks that include private framework tbds
Other
604 stars 207 forks source link

Undefined symbols for architecture _memset #36

Closed haniag closed 2 years ago

haniag commented 4 years ago

What are the steps to reproduce this issue?

Running make

What happens?

Undefined symbols for architecture arm64:
"_memset", referenced from:
__logosLocalCtor_da9539da in Tweak.x.e79a9564.o
ld: symbol(s) not found for architecture arm64

What were you expecting to happen?

Compiled dylib

Any logs, error output, etc?

%ctor{

NSString *pfpath = [[NSBundle mainBundle] privateFrameworksPath];
for (NSString *dir in [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pfpath error:NULL]) {
    NSMutableString *fpath = [pfpath mutableCopy];
    NSArray *components = [dir componentsSeparatedByString:@"."];
    NSString *fname = components[0];
    [fpath appendFormat:@"/%@/%@", dir, fname];
    dlopen([fpath UTF8String], RTLD_NOW);
}

My makfile:

TARGET = iphone:clang:10.3:10.0
ARCHS = arm64 arm64e
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = Tweakee
Tweakee_FILES = Tweak.x
Tweakee_CFLAGS = -fobjc-arc
include $(THEOS_MAKE_PATH)/tweak.mk

Any other comments?

If I comment out the for loop line inside ctor, then it compiles fine. I am not sure what this error got to do with NSFileManager!

What versions of software are you using?

Operating System: macOS 10.14.6

Toolchain Version: Xcode 10.3

SDK Version: 10.3 (patched)

haniag commented 4 years ago

Issue was in using the 10.3 patched SDK. When I reverted to the 12.4 Xcode SDK, it compiled fine. Can this be fixed in patched 10.3 SDK?

inoahdev commented 4 years ago

@haniag It can be fixed in the 10.3 SDK, it just has to be regenerated.

kirb commented 2 years ago

Should be fixed now with the regenerated SDKs.