[winegcc10] Search standard libraries last

Richard Cohen richard.cohen at virgin.net
Thu Sep 18 08:59:33 CDT 2003

Dimitrie O. Paun wrote:

>>   + Remove . from default library search path
> This may break Winelib apps. Did you check that MinGW does not
> search . for libs?
Yes, of course I checked. If any winelib apps break, then they are 
broken and need fixing.

>>   + -lwine needs passed in -L paths
> What do you mean by this?
When using winegcc to build bits of wine itself you cannot rely on the 
installed location to even exist yet. So you must tell winegcc/winewrap 
where to find libwine.so using -L. Here is the relevant bit in the patch:

@@ -376,7 +393,8 @@
      strarray_add(wspec_args, strmake("%s.exe", base_name));
      strarray_add(wspec_args, gui_mode ? "-mgui" : "-mcui");
      strarray_add(wspec_args, wrap_o_name);
-    strarray_add(wspec_args, "-L" DLLDIR);
+    for (i = 0; i < llib_paths->size; i++)
+	strarray_add(wspec_args, llib_paths->base[i]);
      strarray_add(wspec_args, "-lkernel32");
      strarray_add(wspec_args, NULL);

@@ -407,6 +425,8 @@
      strarray_add(wlink_args, strmake("%s.exe.so", base_file));
      strarray_add(wlink_args, wspec_o_name);
      strarray_add(wlink_args, wrap_o_name);
+    for (i = 0; i < llib_paths->size; i++)
+	strarray_add(wlink_args, llib_paths->base[i]);
      strarray_add(wlink_args, NULL);

>>-        strarray_add(lib_files, strmake("-l%s", library));
>>+        /* Probably one of:
>>+        * .def - which winebuild won't find
>>+        * .so  - which winebuild doesn't support
>>+        * .a   - which gcc won't find
>>+        */
>>+        fprintf(stderr, "Ignoring library %s\n", library);
> We need to pass .a files to gcc, otherwise Winelib apps break.
Yes of course.
 > What do you mean "won't find"?
This comment refers to the ones that couldn't be found in the library 
search path.  Maybe I should give up putting comments in ;-}

> And we should pass .so libs to gcc as well.
Sorry - s/winebuild/gcc/ - of course at the moment winegcc doesn't 
recognize them.


More information about the wine-devel mailing list