Date: Wed, 03 Mar 1999 09:04:00 -0500 From: Mark Coletti <mcoletti@clark.net> To: freebsd-questions@freebsd.org Cc: freebsd-bugs@freebsd.org Subject: 2.2.x Patch for ld(1) to compile glib|gtk+|gimp|... Message-ID: <199903031404.JAA02665@laputa.clark.net>
next in thread | raw e-mail | index | archive | help
I was having a very difficult time building glib, gtk+, and the gimp. For example, while building the gimp, the linker was unable to find certain libraries that were created earlier in the build process. Interestingly enough, the LD_LIBRARY_PATH was set to the paths for these on the command line. The man page did indicate that the linker would also use paths specified by this environment variable to find libraries. I discovered that the LD_LIBRARY_SEARCH search paths were appended to the internal search path list after it the linker had given up on locating them. All my linker woes were resolved once I moved the call to append the internal search list to before where the linker went hunting. Here's the patch to apply to ld.c: *** ld.c Thu Aug 7 22:18:00 1997 --- /usr/home/mcoletti/projects/ld/ld.c Sat Jan 23 13:27:39 1999 *************** *** 480,485 **** --- 488,503 ---- number_of_files = 0; output_filename = "a.out"; + /* MAC moved to front + to fix problem + where LD_LIBRARY_PATH libraries are + searched after -L paths. */ + + /* Append the standard search directories to the user-specified ones. */+ add_search_path(getenv("LD_LIBRARY_PATH")); + if (!nostdlib) + std_search_path(); + /* * First compute number_of_files so we know how long to make * file_table. *************** *** 580,589 **** (text_start - text_start_alignment) & (page_size - 1)) errx(1, "incorrect alignment of text start address"); - /* Append the standard search directories to the user-specified ones. */- add_search_path(getenv("LD_LIBRARY_PATH")); - if (!nostdlib) - std_search_path(); } void --- 598,603 ---- Hope this helps! Cheers, Mark -- Mark Coletti | mailto:mcoletti@clark.net | http://www.clark.net/~mcoletti/ Computers save time like kudzu prevents soil erosion. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903031404.JAA02665>