For more compatibility with mingw-gcc. Since meson always names object files with a .obj extension when using mingw, this improves compatibility with meson.
Signed-off-by: Connor Abbott cwabbott0@gmail.com --- tools/winegcc/utils.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index 0b82af90683..63d675122c0 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c @@ -230,6 +230,7 @@ file_type get_file_type(const char* filename)
if (cnt == sizeof(res_sig) && !memcmp(buf, res_sig, sizeof(res_sig))) return file_res; if (strendswith(filename, ".o")) return file_obj; + if (strendswith(filename, ".obj")) return file_obj; if (strendswith(filename, ".a")) return file_arh; if (strendswith(filename, ".res")) return file_res; if (strendswith(filename, ".so")) return file_so;
While you could get 90% of the way with "-lpthread", supporting -pthread should be more reliable and is required for build systems like meson that have special handling for the threads dependency.
Since this is both a compiler (really preprocessor) and linker option, we can't just add it to is_linker_arg().
Signed-off-by: Connor Abbott cwabbott0@gmail.com --- tools/winegcc/winegcc.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index bcabc4f7998..ebc60c1a2c8 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1939,6 +1939,13 @@ int main(int argc, char **argv) opts.output_name = option_arg; raw_compiler_arg = 0; break; + case 'p': + if (strcmp("-pthread", opts.args->base[i]) == 0) + { + raw_compiler_arg = 1; + raw_linker_arg = 1; + } + break; case 's': if (strcmp("-static", opts.args->base[i]) == 0) linking = -1;
These arguments need to be in the correct position so they need to go in the files array.
Signed-off-by: Connor Abbott cwabbott0@gmail.com --- tools/winegcc/winegcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index ebc60c1a2c8..b677457acf5 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -2030,7 +2030,7 @@ int main(int argc, char **argv) opts.debug_file = strdup( Wl->base[++j] ); continue; } - if (!strcmp(Wl->base[j], "--whole-archive") || !strcmp(Wl->base[j], "--no-whole-archive")) + if (!strcmp(Wl->base[j], "--whole-archive") || !strcmp(Wl->base[j], "--no-whole-archive") || !strcmp(Wl->base[j], "--start-group") || !strcmp(Wl->base[j], "--end-group")) { strarray_add( opts.files, strmake( "-Wl,%s", Wl->base[j] )); continue;
In particular meson uses -Wl,--out-implib=...
Signed-off-by: Connor Abbott cwabbott0@gmail.com --- tools/winegcc/winegcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index b677457acf5..efe76821cd8 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1982,7 +1982,7 @@ int main(int argc, char **argv) if (strncmp("-Wl,", opts.args->base[i], 4) == 0) { unsigned int j; - strarray* Wl = strarray_fromstring(opts.args->base[i] + 4, ","); + strarray* Wl = strarray_fromstring(opts.args->base[i] + 4, ",="); for (j = 0; j < Wl->size; j++) { if (!strcmp(Wl->base[j], "--image-base") && j < Wl->size - 1)