/[gentoo-alt]/trunk/toolchain-prefix-wrapper/ld/ldwrapper.c
Gentoo

Diff of /trunk/toolchain-prefix-wrapper/ld/ldwrapper.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1607 Revision 1608
727 "/lib", strlen("/lib"), 727 "/lib", strlen("/lib"),
728 NULL); 728 NULL);
729 } 729 }
730} 730}
731 731
732/* Append the system libdirs from this host to libpath. 732/* Append the system libdirs from this host libpath.
733 * This only needs to be done when: 733 * This only needs to be done when:
734 * *) this is a native build, 734 * *) this is a native build,
735 * (because only libs with target's binary format make sense) 735 * (because only libs with target's binary format make sense)
736 * additionally, append the system libdirs from this host to runpath.
737 *
738 * This only needs to be done (besides being a native build) when:
736 * *) and this is a cross-prefix build 739 * *) this is a cross eprefix build,
737 * (or we would end up with duplicate libdirs 740 * *) or ROOT is not empty,
738 * because of add_target_system_libdirs() ) 741 * *) and the system libdir does not exist within root
739 * *) and ${ROOT} is empty, 742 * (because we would end up with duplicate runpath already added
740 * (because it's impossible to run binaries from within $ROOT, 743 * by add_target_system_libdirs otherwise).
741 * so they do not require anything from outside $ROOT).
742 */ 744 */
743static void add_host_system_libdirs(LdWrapperData* data) 745static void add_host_system_libdirs(LdWrapperData* data)
744{ 746{
745 struct libdir { 747 struct libdir {
746 char const *path; int len; 748 char const *path; int len;
751 { "/lib64", strlen("/lib64"), }, 753 { "/lib64", strlen("/lib64"), },
752 { "/lib", strlen("/lib"), }, 754 { "/lib", strlen("/lib"), },
753 { NULL, -1 }, 755 { NULL, -1 },
754 }; 756 };
755 struct libdir const * l = libdirs; 757 struct libdir const * l = libdirs;
756 if (!data->isCrossTriplet && StringGetLength(data->root) == 0 && data->isCrossEprefix) { 758 if (data->isCrossTriplet) return;
757 while(l->path != NULL) { 759 while(l->path != NULL) {
758 add_libpath(data, data->pluginIn.sysLibpath, TestAndAddLibpath, 760 if (add_libpath(data, data->pluginIn.sysLibpath, TestAndAddLibpath,
759 "append host's target-system-libdir to sys-libpath", 761 "append host's system-libdir to sys-libpath",
762 StringGetBuffer(data->host.eprefix), StringGetLength(data->host.eprefix),
763 l->path, l->len,
764 NULL)) {
765 if (data->isCrossEprefix
766 || ( StringGetLength(data->root) > 0
767 && add_libpath(data, NULL, TestLibpath,
768 "test host's sytem-libdir in ROOT to avoid duplicate sys-runpath",
769 StringGetBuffer(data->root), StringGetLength(data->root),
760 StringGetBuffer(data->host.eprefix), StringGetLength(data->host.eprefix), 770 StringGetBuffer(data->host.eprefix), StringGetLength(data->host.eprefix),
761 l->path, l->len, 771 l->path, l->len,
772 NULL) == 0
773 )
774 ) {
775 add_libpath(data, data->pluginIn.sysRunpath, AddLibpath,
776 "append host's system-libdir to sys-runpath",
777 StringGetBuffer(data->host.eprefix), StringGetLength(data->host.eprefix),
778 l->path, l->len,
762 NULL); 779 NULL);
780 }
781 }
763 l++; 782 l++;
764 }
765 } 783 }
766} 784}
767 785
768static void callPlugin(LdWrapperData* data, LdPluginFct plugins) 786static void callPlugin(LdWrapperData* data, LdPluginFct plugins)
769{ 787{

Legend:
Removed from v.1607  
changed lines
  Added in v.1608

  ViewVC Help
Powered by ViewVC 1.1.20