[PATCH 2/2] winegcc: Do use DSO full name for .so arguments
Kirill Smelkov
kirr at mns.spb.ru
Fri Apr 23 03:55:28 CDT 2010
$ cat hello.c
#include <stdio.h>
void hello() { printf("Hello World!\n"); }
$ cat main.c
extern void hello();
int main() { hello(); return 0; }
Compare
$ gcc -shared -o hello.so hello.c
$ gcc -o hello_elf main.c hello.so
with
$ winegcc -o hello_wine main.c hello.so
/usr/bin/ld: cannot find -lhello.so
collect2: ld returned 1 exit status
distcc[9736] ERROR: compile (null) on localhost failed
winegcc: gcc failed
This too fails with even lib<something>.so when libraries are accessed
with explicit path and not through -L
$ mkdir A/ && mv hello.so A/libhello.so
$ winegcc -o hello_wine main.c A/libhello.so
/usr/bin/ld: cannot find -lA/libhello.so
collect2: ld returned 1 exit status
distcc[9813] ERROR: compile (null) on localhost failed
winegcc: gcc failed
Sorry for long log message, but I had to describe it somehow, especially
because there is 1cb751 (winegcc: Don't use the library full name for
.so libs.) which seemingly did the opposite.
However we do not break old behaviour for -l<solib> which is still
passed down as -l<solib> and not /path/to/lib<solib>.so, thus this
should be a win/win.
NOTE Windows codepath is untested, but I doubt there are .so on Windows.
Sorry again for long description. If something is wrong - could you
please provide feedback?
Thanks beforehand,
Kirill
---
tools/winegcc/winegcc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index b7c0f91..10a4d7a 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -739,10 +739,10 @@ static void build(struct options* opts)
switch(files->base[j][1])
{
case 'l':
- case 's':
case 'd':
strarray_add(link_args, strmake("-l%s", name));
break;
+ case 's':
case 'o':
strarray_add(link_args, name);
break;
@@ -922,9 +922,9 @@ static void build(struct options* opts)
switch(files->base[j][1])
{
case 'l':
- case 's':
strarray_add(link_args, strmake("-l%s", name));
break;
+ case 's':
case 'a':
case 'o':
strarray_add(link_args, name);
--
1.7.1.rc2.12.g3a006
More information about the wine-patches
mailing list