mosquitto: fix build
[oi-userland.git] / components / runtime / wine / patches / 07-winegcc_ar.patch
blob613ea7ee82e40f9745073b73d3943b55cdba9450
1 diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
2 index fa4407f913..c1f6d11fde 100644
3 --- a/tools/winegcc/winegcc.c
4 +++ b/tools/winegcc/winegcc.c
5 @@ -964,6 +964,7 @@ static void build(struct options* opts)
7 strarray *lib_dirs, *files;
8 strarray *spec_args, *link_args;
9 + strarray *src_args, *lib_args, *ar_args;
10 char *output_file, *output_path;
11 const char *spec_o_name, *libgcc = NULL;
12 const char *output_name, *spec_file, *lang;
13 @@ -1203,17 +1204,20 @@ static void build(struct options* opts)
15 strarray_add(link_args, spec_o_name);
17 + src_args = strarray_alloc();
18 + lib_args = strarray_alloc();
19 + ar_args = strarray_alloc();
20 for ( j = 0; j < files->size; j++ )
22 const char* name = files->base[j] + 2;
23 switch(files->base[j][1])
25 case 'l':
26 - strarray_add(link_args, strmake("-l%s", name));
27 + strarray_add(lib_args, strmake("-l%s", name));
28 break;
29 case 's':
30 case 'o':
31 - strarray_add(link_args, name);
32 + strarray_add(src_args, name);
33 break;
34 case 'a':
35 if (is_pe && !opts->lib_suffix && strchr(name, '/'))
36 @@ -1231,17 +1235,20 @@ static void build(struct options* opts)
38 if (ext) *ext = 0;
39 p += 3;
40 - strarray_add(link_args, strmake("-L%s", lib ));
41 - strarray_add(link_args, strmake("-l%s", p ));
42 + strarray_add(lib_args, strmake("-L%s", lib ));
43 + strarray_add(lib_args, strmake("-l%s", p ));
44 free( lib );
45 break;
47 free( lib );
49 - strarray_add(link_args, name);
50 + strarray_add(ar_args, name);
51 break;
54 + strarray_addall(link_args, src_args);
55 + strarray_addall(link_args, ar_args);
56 + strarray_addall(link_args, lib_args);
58 if (!opts->nostdlib && !is_pe)
60 --
61 2.23.0