Skip to content

Commit 94c6bb5

Browse files
radekdoulikjonpryor
authored andcommitted
Do not build 32bit native libraries (#376)
[Xcode 10.0 deprecates compiling of 32-bit applications][0]. > The macOS 10.14 SDK no longer contains support for compiling > 32-bit applications. If developers need to compile for i386, > Xcode 9.4 or earlier is required. (39858111) So just build 64-bit everywhere. [0]: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035632
1 parent 836f741 commit 94c6bb5

File tree

3 files changed

+9
-33
lines changed

3 files changed

+9
-33
lines changed

Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,7 @@ NATIVE_TIMING_LIB = libNativeTiming$(NATIVE_EXT)
102102

103103
bin/Test$(CONFIGURATION)/$(NATIVE_TIMING_LIB): tests/NativeTiming/timing.c $(wildcard $(JI_JDK_INCLUDE_PATHS)/jni.h)
104104
mkdir -p `dirname "$@"`
105-
ifeq ($(OS),Darwin)
106-
gcc -g -shared -m32 -o bin/Test$(CONFIGURATION)/libNativeTiming-m32.dylib $< $(JI_JDK_INCLUDE_PATHS:%=-I%)
107-
gcc -g -shared -m64 -o bin/Test$(CONFIGURATION)/libNativeTiming-m64.dylib $< $(JI_JDK_INCLUDE_PATHS:%=-I%)
108-
lipo bin/Test$(CONFIGURATION)/libNativeTiming-m32.dylib bin/Test$(CONFIGURATION)/libNativeTiming-m64.dylib -create \
109-
-output "$@"
110-
endif
111-
ifeq ($(OS),Linux)
112-
gcc -g -shared -o $@ $< -m32 $(JI_JDK_INCLUDE_PATHS:%=-I%)
113-
endif
105+
gcc -g -shared -m64 -o $@ $< $(JI_JDK_INCLUDE_PATHS:%=-I%)
114106

115107
# Usage: $(call TestAssemblyTemplate,assembly-basename)
116108
define TestAssemblyTemplate

src/java-interop/java-interop.csproj

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@
4040
<Compile Include="java-interop-mono.c" />
4141
<Compile Include="java-interop-gc-bridge-mono.c" />
4242
</ItemGroup>
43-
<ItemGroup>
44-
<MacLibLipo Include="obj\lib$(OutputName)-m32.dylib">
45-
<Arch>-m32</Arch>
46-
</MacLibLipo>
47-
<MacLibLipo Include="obj\lib$(OutputName)-m64.dylib">
48-
<Arch>-m64</Arch>
49-
</MacLibLipo>
50-
</ItemGroup>
5143
<PropertyGroup>
5244
<BuildDependsOn>
5345
BuildJni_c;
@@ -66,21 +58,13 @@
6658
<MakeDir Directories="$(OutputPath)" />
6759
<Exec Command="$(Runtime) &quot;$(JNIEnvGenPath)\jnienv-gen.exe&quot; jni.g.cs jni.c" />
6860
</Target>
61+
<PropertyGroup>
62+
<_MacLib>$(OutputPath)\lib$(OutputName).dylib</_MacLib>
63+
</PropertyGroup>
6964
<Target Name="BuildMac"
70-
Condition=" '$(OS)' != 'Windows_NT' And Exists ('/Library/Frameworks/')"
71-
DependsOnTargets="BuildMacLibraries"
72-
Inputs="@(MacLibLipo)"
73-
Outputs="$(OutputPath)\lib$(OutputName).dylib">
74-
<PropertyGroup>
75-
<_Files>@(MacLibLipo -&gt; '%(Identity)', ' ')</_Files>
76-
</PropertyGroup>
77-
<Message Text="Inputs: MacLibLipo=@(MacLibLipo)" />
78-
<Exec Command="lipo $(_Files) -create -output $(OutputPath)\lib$(OutputName).dylib" />
79-
</Target>
80-
<Target Name="BuildMacLibraries"
8165
Condition=" '$(OS)' != 'Windows_NT' And Exists ('/Library/Frameworks/')"
8266
Inputs="@(Compile)"
83-
Outputs="@(MacLibLipo)">
67+
Outputs="$(_MacLib)">
8468
<PropertyGroup>
8569
<_FixedDefines>$(DefineSymbols.Split(' '))</_FixedDefines>
8670
</PropertyGroup>
@@ -95,9 +79,9 @@
9579
<_Files>@(Compile -&gt; '%(Identity)', ' ')</_Files>
9680
</PropertyGroup>
9781
<MakeDir Directories="obj" />
98-
<Exec Command="gcc -g -shared -std=c99 -o &quot;%(MacLibLipo.Identity)&quot; %(MacLibLipo.Arch) $(_CppFlags) $(_LinkFlags) $(_Libs) $(_Includes) $(_Files)" />
82+
<Exec Command="gcc -g -shared -m64 -std=c99 -o &quot;$(_MacLib)&quot; $(_CppFlags) $(_LinkFlags) $(_Libs) $(_Includes) $(_Files)" />
9983
<!-- Mono 4.4.0 (mono-4.4.0-branch/a3fabf1) has an incorrect shared library name. Fix it -->
100-
<Exec Command="install_name_tool -change /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/package-root/lib/libmonosgen-2.0.1.dylib /Library/Frameworks/Mono.framework/Libraries/libmonosgen-2.0.1.dylib &quot;%(MacLibLipo.Identity)&quot;" />
84+
<Exec Command="install_name_tool -change /private/tmp/source-mono-4.4.0/bockbuild-mono-4.4.0-branch/profiles/mono-mac-xamarin/package-root/lib/libmonosgen-2.0.1.dylib /Library/Frameworks/Mono.framework/Libraries/libmonosgen-2.0.1.dylib &quot;$(_MacLib)&quot;" />
10185
</Target>
10286
<Target Name="BuildUnixLibraries"
10387
Condition=" '$(OS)' != 'Windows_NT' And !Exists ('/Library/Frameworks/')"

tests/NativeTiming/NativeTiming.cproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<CompileTarget>SharedLibrary</CompileTarget>
2020
<DefineSymbols>DEBUG MONODEVELOP</DefineSymbols>
2121
<SourceDirectory>.</SourceDirectory>
22-
<ExtraCompilerArguments>-m32 -I /System/Library/Frameworks/JavaVM.framework/Headers</ExtraCompilerArguments>
23-
<ExtraLinkerArguments>-shared -m32</ExtraLinkerArguments>
22+
<ExtraCompilerArguments>-m64 -I /System/Library/Frameworks/JavaVM.framework/Headers</ExtraCompilerArguments>
23+
<ExtraLinkerArguments>-shared -m64</ExtraLinkerArguments>
2424
</PropertyGroup>
2525
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2626
<OutputPath>bin\Release</OutputPath>

0 commit comments

Comments
 (0)