Updated Makefile to compile correctly again.

Added a really ugly hack so that the ABI versions of the three .m files are not checked.  This will (hopefully!) prevent the GC being enabled when libobjc is loaded after being compiled with -fobjc-gc.
main
theraven 15 years ago
parent 3385e7a724
commit 444688895a

@ -8,7 +8,8 @@ release include:
- Support for Apple-compatible garbage collection APIs, along with extensions
to support CoreFoundation-style explicit reference counting in a garbage
collected environment. This uses the Boehm garbage collector.
collected environment. This uses the Boehm garbage collector and is enabled
the boehm_gc=yes option when building.
- This is the first release to provide a superset of the functionality provided
by the Mac Objective-C runtime, as shipped with OS X 10.6.
- The LLVM optimisation passes have been improved and better tested. Code

@ -35,6 +35,7 @@ OBJECTS = \
dtable.o\
eh_personality.o\
encoding2.o\
gc_none.o\
hash_table.o\
hooks.o\
ivar.o\

@ -4,6 +4,7 @@
#include "gc_ops.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
/**
* The smallest ABI version number of loaded modules.
@ -62,8 +63,29 @@ static int known_abi_count =
PRIVATE enum objc_gc_mode current_gc_mode = GC_Optional;
static BOOL endsWith(const char *string, const char *suffix)
{
char *interior = strstr(string, suffix);
return (interior && (strlen(string) == strlen(interior)));
}
PRIVATE BOOL objc_check_abi_version(struct objc_module_abi_8 *module)
{
static int runtime_modules = 3;
// As a quick and ugly hack, skip these three tests for the .m files in the
// runtime. They should (in theory, at least) be aware of the GC mode and
// behave accordingly.
if (runtime_modules > 0)
{
if (endsWith(module->name, "properties.m") ||
endsWith(module->name, "associate.m") ||
endsWith(module->name, "Protocol2.m"))
{
runtime_modules--;
return YES;
}
}
fprintf(stderr, "Loading module %s\n", module->name);
unsigned long version = module->version;
unsigned long module_size = module->size;
enum objc_gc_mode gc_mode = (version < gc_abi) ? GC_None

Loading…
Cancel
Save