From owner-freebsd-questions Wed Mar 3 6:10:44 1999 Delivered-To: freebsd-questions@freebsd.org Received: from laputa.clark.net (laputa.clark.net [168.143.15.95]) by hub.freebsd.org (Postfix) with ESMTP id 24B4814BD4; Wed, 3 Mar 1999 06:10:27 -0800 (PST) (envelope-from mcoletti@laputa.clark.net) Received: from laputa.clark.net (localhost.clark.net [127.0.0.1]) by laputa.clark.net (8.8.8/8.8.8) with ESMTP id JAA02665; Wed, 3 Mar 1999 09:04:00 -0500 (EST) (envelope-from mcoletti@laputa.clark.net) Message-Id: <199903031404.JAA02665@laputa.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|... Date: Wed, 03 Mar 1999 09:04:00 -0500 From: Mark Coletti Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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-questions" in the body of the message