summaryrefslogtreecommitdiffstats
path: root/src/ocaml-flexdll-1-fixes.patch
blob: ad5f0be90be946b9c27abb50d05fd91558769e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "fix@me" <fix@me>
Date: Sat, 23 Jun 2012 22:25:50 +0200
Subject: [PATCH 1/1] modifications for cross-compilation

part of this patch is taken from
https://code.google.com/archive/p/flexdll/issues/2

diff --git a/Makefile b/Makefile
index 1111111..2222222 100644
--- a/Makefile
+++ b/Makefile
@@ -43,12 +43,12 @@ MSVCC64 = $(MSVCC_ROOT)/amd64/cl.exe /nologo /MD -D_CRT_SECURE_NO_DEPRECATE /GS-
 CYGCC = gcc 
 OCAMLOPT = ocamlopt
 #OCAMLOPT = FLEXLINKFLAGS=-real-manifest ocamlopt
-#LINKFLAGS = unix.cmxa
+LINKFLAGS = unix.cmxa
 
 #ifeq ($(SYSTEM), win64)
 #LINKFLAGS=
 #else
-LINKFLAGS = -ccopt "-link version_res.o"
+#LINKFLAGS = -ccopt "-link version_res.o"
 #endif
 
 support:
@@ -62,7 +62,7 @@ build_mingw64: flexdll_mingw64.o flexdll_initer_mingw64.o
 
 OBJS = version.ml coff.ml cmdline.ml create_dll.ml reloc.ml
 
-flexlink.exe: $(OBJS) version_res.o
+flexlink.exe: $(OBJS)
 	@echo Building flexlink.exe with TOOLCHAIN=$(TOOLCHAIN)
 	rm -f flexlink.exe
 	$(OCAMLOPT) -w -105 -o flexlink.exe $(LINKFLAGS) $(OBJS)
diff --git a/reloc.ml b/reloc.ml
index 1111111..2222222 100644
--- a/reloc.ml
+++ b/reloc.ml
@@ -977,7 +977,7 @@ let setup_toolchain () =
       !dirs @
       [
        Filename.dirname (get_output1 (!gcc ^ " -print-libgcc-file-name"));
-       get_output1 (!gcc ^ " -print-sysroot") ^ "/mingw/lib";
+       (*get_output1 (!gcc ^ " -print-sysroot") ^ "/mingw/lib";*)
       ];
     default_libs :=
       ["-lmingw32"; "-lgcc"; "-lmoldname"; "-lmingwex"; "-lmsvcrt";