mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
fix darwin build
This commit is contained in:
parent
357bd29460
commit
c37f0dcf18
4
makefile
4
makefile
@ -90,6 +90,7 @@ ifeq ($(platform),darwin)
|
|||||||
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \
|
build-cflags = $(common-cflags) -fPIC -fvisibility=hidden \
|
||||||
-I$(JAVA_HOME)/include/linux -I$(src)
|
-I$(JAVA_HOME)/include/linux -I$(src)
|
||||||
lflags = $(common-lflags) -ldl -framework CoreFoundation
|
lflags = $(common-lflags) -ldl -framework CoreFoundation
|
||||||
|
rdynamic =
|
||||||
strip-all = -S -x
|
strip-all = -S -x
|
||||||
binaryToMacho = $(native-build)/binaryToMacho
|
binaryToMacho = $(native-build)/binaryToMacho
|
||||||
so-suffix = .jnilib
|
so-suffix = .jnilib
|
||||||
@ -330,6 +331,7 @@ $(binaryToMacho): $(src)/binaryToMacho.cpp
|
|||||||
$(cxx) $(^) -o $(@)
|
$(cxx) $(^) -o $(@)
|
||||||
|
|
||||||
$(classpath-object): $(build)/classpath.jar $(binaryToMacho)
|
$(classpath-object): $(build)/classpath.jar $(binaryToMacho)
|
||||||
|
@echo "creating $(@)"
|
||||||
ifeq ($(platform),darwin)
|
ifeq ($(platform),darwin)
|
||||||
$(binaryToMacho) $(build)/classpath.jar \
|
$(binaryToMacho) $(build)/classpath.jar \
|
||||||
__binary_classpath_jar_start __binary_classpath_jar_end > $(@)
|
__binary_classpath_jar_start __binary_classpath_jar_end > $(@)
|
||||||
@ -373,7 +375,7 @@ $(dynamic-library): \
|
|||||||
$(boot-object)
|
$(boot-object)
|
||||||
@echo "linking $(@)"
|
@echo "linking $(@)"
|
||||||
$(cc) $(^) $(shared) $(lflags) -o $(@)
|
$(cc) $(^) $(shared) $(lflags) -o $(@)
|
||||||
$(strip) $(@)
|
$(strip) $(strip-all) $(@)
|
||||||
|
|
||||||
$(executable-dynamic): $(driver-dynamic-object) $(dynamic-library)
|
$(executable-dynamic): $(driver-dynamic-object) $(dynamic-library)
|
||||||
@echo "linking $(@)"
|
@echo "linking $(@)"
|
||||||
|
@ -42,7 +42,7 @@ writeObject(FILE* out, const uint8_t* data, unsigned size,
|
|||||||
MH_OBJECT, // filetype,
|
MH_OBJECT, // filetype,
|
||||||
2, // ncmds
|
2, // ncmds
|
||||||
sizeof(segment_command)
|
sizeof(segment_command)
|
||||||
+ (sizeof(section) * 2)
|
+ sizeof(section)
|
||||||
+ sizeof(symtab_command), // sizeofcmds
|
+ sizeof(symtab_command), // sizeofcmds
|
||||||
0 // flags
|
0 // flags
|
||||||
};
|
};
|
||||||
@ -55,23 +55,23 @@ writeObject(FILE* out, const uint8_t* data, unsigned size,
|
|||||||
pad(size), // vmsize
|
pad(size), // vmsize
|
||||||
sizeof(mach_header)
|
sizeof(mach_header)
|
||||||
+ sizeof(segment_command)
|
+ sizeof(segment_command)
|
||||||
+ (sizeof(section) * 2)
|
+ sizeof(section)
|
||||||
+ sizeof(symtab_command), // fileoff
|
+ sizeof(symtab_command), // fileoff
|
||||||
pad(size), // filesize
|
pad(size), // filesize
|
||||||
7, // maxprot
|
7, // maxprot
|
||||||
7, // initprot
|
7, // initprot
|
||||||
2, // nsects
|
1, // nsects
|
||||||
0 // flags
|
0 // flags
|
||||||
};
|
};
|
||||||
|
|
||||||
section sect1 = {
|
section sect = {
|
||||||
"__const", // sectname
|
"__const", // sectname
|
||||||
"__TEXT", // segname
|
"__TEXT", // segname
|
||||||
0, // addr
|
0, // addr
|
||||||
pad(size), // size
|
pad(size), // size
|
||||||
sizeof(mach_header)
|
sizeof(mach_header)
|
||||||
+ sizeof(segment_command)
|
+ sizeof(segment_command)
|
||||||
+ (sizeof(section) * 2)
|
+ sizeof(section)
|
||||||
+ sizeof(symtab_command), // offset
|
+ sizeof(symtab_command), // offset
|
||||||
0, // align
|
0, // align
|
||||||
0, // reloff
|
0, // reloff
|
||||||
@ -81,30 +81,12 @@ writeObject(FILE* out, const uint8_t* data, unsigned size,
|
|||||||
0, // reserved2
|
0, // reserved2
|
||||||
};
|
};
|
||||||
|
|
||||||
section sect2 = {
|
|
||||||
"__const", // sectname
|
|
||||||
"__TEXT", // segname
|
|
||||||
0, // addr
|
|
||||||
0, // size
|
|
||||||
sizeof(mach_header)
|
|
||||||
+ sizeof(segment_command)
|
|
||||||
+ (sizeof(section) * 2)
|
|
||||||
+ sizeof(symtab_command)
|
|
||||||
+ size, // offset
|
|
||||||
0, // align
|
|
||||||
0, // reloff
|
|
||||||
0, // nreloc
|
|
||||||
S_REGULAR, // flags
|
|
||||||
0, // reserved1
|
|
||||||
0, // reserved2
|
|
||||||
};
|
|
||||||
|
|
||||||
symtab_command symbolTable = {
|
symtab_command symbolTable = {
|
||||||
LC_SYMTAB, // cmd
|
LC_SYMTAB, // cmd
|
||||||
sizeof(symtab_command), // cmdsize
|
sizeof(symtab_command), // cmdsize
|
||||||
sizeof(mach_header)
|
sizeof(mach_header)
|
||||||
+ sizeof(segment_command)
|
+ sizeof(segment_command)
|
||||||
+ (sizeof(section) * 2)
|
+ sizeof(section)
|
||||||
+ sizeof(symtab_command)
|
+ sizeof(symtab_command)
|
||||||
+ pad(size), // symoff
|
+ pad(size), // symoff
|
||||||
2, // nsyms
|
2, // nsyms
|
||||||
@ -128,16 +110,15 @@ writeObject(FILE* out, const uint8_t* data, unsigned size,
|
|||||||
{
|
{
|
||||||
reinterpret_cast<char*>(1 + startNameLength), // n_un
|
reinterpret_cast<char*>(1 + startNameLength), // n_un
|
||||||
N_SECT | N_EXT, // n_type
|
N_SECT | N_EXT, // n_type
|
||||||
2, // n_sect
|
1, // n_sect
|
||||||
0, // n_desc
|
0, // n_desc
|
||||||
0 // n_value
|
size // n_value
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fwrite(&header, 1, sizeof(header), out);
|
fwrite(&header, 1, sizeof(header), out);
|
||||||
fwrite(&segment, 1, sizeof(segment), out);
|
fwrite(&segment, 1, sizeof(segment), out);
|
||||||
fwrite(§1, 1, sizeof(sect1), out);
|
fwrite(§, 1, sizeof(sect), out);
|
||||||
fwrite(§2, 1, sizeof(sect2), out);
|
|
||||||
fwrite(&symbolTable, 1, sizeof(symbolTable), out);
|
fwrite(&symbolTable, 1, sizeof(symbolTable), out);
|
||||||
|
|
||||||
fwrite(data, 1, size, out);
|
fwrite(data, 1, size, out);
|
||||||
|
Loading…
Reference in New Issue
Block a user