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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
diff --new-file --unified --recursive --text binfmtc-0.17/binfmtasm-interpreter.1 binfmtc-0.17.patch/binfmtasm-interpreter.1
--- binfmtc-0.17/binfmtasm-interpreter.1 2011-09-21 03:24:32.000000000 +0200
+++ binfmtc-0.17.patch/binfmtasm-interpreter.1 2021-11-14 11:38:50.394059216 +0100
@@ -24,7 +24,9 @@
at the beginning of the file.
That line also is used to specify the additional command-line options
-for the assmebler.
+for the assmebler. If "%s" is included, this will be replaced with the
+filename, so you can add options after the file, e.g. linker
+options. If "%s" is not found, the filename is the last argument.
.SH "ENVIRONMENT"
.TP
diff --new-file --unified --recursive --text binfmtc-0.17/binfmtc-interpreter.1 binfmtc-0.17.patch/binfmtc-interpreter.1
--- binfmtc-0.17/binfmtc-interpreter.1 2011-09-21 03:24:36.000000000 +0200
+++ binfmtc-0.17.patch/binfmtc-interpreter.1 2021-11-14 11:38:08.770794351 +0100
@@ -24,7 +24,9 @@
at the beginning of the file.
That line also is used to specify the additional command-line options
-for C compiler.
+for C compiler. If "%s" is included, this will be replaced with the
+filename, so you can add options after the file, e.g. linker
+options. If "%s" is not found, the filename is the last argument.
.SH "ENVIRONMENT"
.TP
diff --new-file --unified --recursive --text binfmtc-0.17/binfmtc-interpreter.c binfmtc-0.17.patch/binfmtc-interpreter.c
--- binfmtc-0.17/binfmtc-interpreter.c 2008-08-30 20:56:10.000000000 +0200
+++ binfmtc-0.17.patch/binfmtc-interpreter.c 2021-11-14 11:35:32.974607532 +0100
@@ -38,6 +38,7 @@
char* path_delimiter;
char* tempfilename = NULL;
char* s = NULL;
+ char* tmpcommandline = NULL;
char* gcccommandline = NULL;
size_t size;
FILE* f;
@@ -99,14 +100,27 @@
s[i]=0;
}
- asprintf (&gcccommandline,
- "%s -o %s %s %s %s \"%s\"",
+ asprintf (&tmpcommandline,
+ "%s -o %s %s %s %s",
compiler_name(),
tempfilename,
gcc_x,
- s+BINFMTC_MAGIC_LEN,
- default_options(),
- basename(sourcename));
+ default_options(),
+ s+BINFMTC_MAGIC_LEN);
+
+ if(strstr(tmpcommandline, "%s"))
+ {
+ asprintf(&gcccommandline,
+ tmpcommandline,
+ basename(sourcename));
+ }
+ else
+ {
+ asprintf(&gcccommandline,
+ "%s \"%s\"",
+ tmpcommandline,
+ basename(sourcename));
+ }
if (BINFMTC_DEBUG)
fprintf(stderr, "binfmtc: Execute command-line: %s\n", gcccommandline);
diff --new-file --unified --recursive --text binfmtc-0.17/binfmtcxx-interpreter.1 binfmtc-0.17.patch/binfmtcxx-interpreter.1
--- binfmtc-0.17/binfmtcxx-interpreter.1 2011-09-21 03:24:40.000000000 +0200
+++ binfmtc-0.17.patch/binfmtcxx-interpreter.1 2021-11-14 11:38:31.820753671 +0100
@@ -24,7 +24,9 @@
at the beginning of the file.
That line also is used to specify the additional command-line options
-for C++ compiler.
+for C++ compiler. If "%s" is included, this will be replaced with the
+filename, so you can add options after the file, e.g. linker
+options. If "%s" is not found, the filename is the last argument.
.SH "ENVIRONMENT"
.TP
diff --new-file --unified --recursive --text binfmtc-0.17/binfmtf95-interpreter.1 binfmtc-0.17.patch/binfmtf95-interpreter.1
--- binfmtc-0.17/binfmtf95-interpreter.1 2011-09-21 03:24:48.000000000 +0200
+++ binfmtc-0.17.patch/binfmtf95-interpreter.1 2021-11-14 11:40:20.493982386 +0100
@@ -24,7 +24,9 @@
at the beginning of the file.
That line also is used to specify the additional command-line options
-for Fortran compiler.
+for Fortran compiler. If "%s" is included, this will be replaced with the
+filename, so you can add options after the file, e.g. linker
+options. If "%s" is not found, the filename is the last argument.
.SH "ENVIRONMENT"
.TP
diff --new-file --unified --recursive --text binfmtc-0.17/binfmtf-interpreter.1 binfmtc-0.17.patch/binfmtf-interpreter.1
--- binfmtc-0.17/binfmtf-interpreter.1 2011-09-21 03:24:44.000000000 +0200
+++ binfmtc-0.17.patch/binfmtf-interpreter.1 2021-11-14 11:40:25.117314183 +0100
@@ -24,7 +24,9 @@
at the beginning of the file.
That line also is used to specify the additional command-line options
-for Fortran compiler.
+for Fortran compiler. If "%s" is included, this will be replaced with the
+filename, so you can add options after the file, e.g. linker
+options. If "%s" is not found, the filename is the last argument.
.SH "ENVIRONMENT"
.TP
diff --new-file --unified --recursive --text binfmtc-0.17/realcsh.c binfmtc-0.17.patch/realcsh.c
--- binfmtc-0.17/realcsh.c 2008-08-30 20:56:10.000000000 +0200
+++ binfmtc-0.17.patch/realcsh.c 2021-11-14 11:35:32.974607532 +0100
@@ -1,4 +1,4 @@
-/*BINFMTC: -lreadline -I/usr/include/readline
+/*BINFMTC: "%s" -lreadline -I/usr/include/readline
exit 1
* binfmt_misc C Interpreter
diff --new-file --unified --recursive --text binfmtc-0.17/realcxxsh.cc binfmtc-0.17.patch/realcxxsh.cc
--- binfmtc-0.17/realcxxsh.cc 2008-08-30 20:56:10.000000000 +0200
+++ binfmtc-0.17.patch/realcxxsh.cc 2021-11-14 11:35:32.974607532 +0100
@@ -1,4 +1,4 @@
-/*BINFMTCXX: -lreadline -I/usr/include/readline
+/*BINFMTCXX: "%s" -lreadline -I/usr/include/readline
exit 1
* binfmt_misc C++ Interpreter
|