From owner-svn-src-all@FreeBSD.ORG Mon Mar 14 22:51:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC12106567C; Mon, 14 Mar 2011 22:51:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8F898FC21; Mon, 14 Mar 2011 22:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2EMpp4T013911; Mon, 14 Mar 2011 22:51:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2EMppwN013908; Mon, 14 Mar 2011 22:51:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201103142251.p2EMppwN013908@svn.freebsd.org> From: Dimitry Andric Date: Mon, 14 Mar 2011 22:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219648 - in stable/8/gnu/usr.bin: binutils/ld cc/cc_tools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 22:51:51 -0000 Author: dim Date: Mon Mar 14 22:51:51 2011 New Revision: 219648 URL: http://svn.freebsd.org/changeset/base/219648 Log: Partially MFC r209867 and r215439, to provide rudimentary support for linking i386 (32 bit) executables on amd64, using gcc's -m32 option. r209867 introduces the needed multilib options to gcc's multilib.h, but was originally intended just for powerpc64. r215439 teaches the linker to search in /usr/lib32 for elf_i386_fbsd output, and amends r209867 to apply to amd64 too. NOTE: this MFC does NOT provide full support for compiling and linking all existing 32 bit programs on amd64, since /usr/include/machine still contains amd64-specific headers. Though simple "Hello World" type programs work, anything relying on machine-specific types might fail in various interesting ways. You have been warned. :) MFC r209867: Teach our toolchain how to generate 64-bit PowerPC binaries. This fixes a variety of bugs in binutils related to handling of 64-bit PPC ELF, provides a GCC configuration for 64-bit PowerPC on FreeBSD, and associated build systems tweaks. Obtained from: projects/ppc64 MFC r215439: Let gcc and ld know where to find 32 bit libraries on amd64. Reviewed by: arch@ Approved by: kib (mentor) Modified: stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 stable/8/gnu/usr.bin/cc/cc_tools/Makefile Directory Properties: stable/8/gnu/usr.bin/binutils/ld/ (props changed) stable/8/gnu/usr.bin/cc/cc_tools/ (props changed) Modified: stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 ============================================================================== --- stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 Mon Mar 14 22:42:41 2011 (r219647) +++ stable/8/gnu/usr.bin/binutils/ld/Makefile.amd64 Mon Mar 14 22:51:51 2011 (r219648) @@ -12,7 +12,7 @@ e${NATIVE_EMULATION}.c: emulparams/${NAT ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} X86_EMULATION= elf_i386_fbsd -_i386_path= \"${TOOLS_PREFIX}/usr/lib/i386\" +_i386_path= \"${TOOLS_PREFIX}/usr/lib32\" EMS+= ${X86_EMULATION} .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${X86_EMULATION}.${ext} Modified: stable/8/gnu/usr.bin/cc/cc_tools/Makefile ============================================================================== --- stable/8/gnu/usr.bin/cc/cc_tools/Makefile Mon Mar 14 22:42:41 2011 (r219647) +++ stable/8/gnu/usr.bin/cc/cc_tools/Makefile Mon Mar 14 22:51:51 2011 (r219648) @@ -303,12 +303,22 @@ GENSRCS+= gcov-iov.h # Multilib config file multilib.h: +.if ${TARGET_ARCH} == "amd64" + echo 'static const char *const multilib_raw[] = { \ + ". !m64 !m32;", \ + "64:../lib m64 !m32;", \ + "32:../lib32 !m64 m32;", NULL };' > ${.TARGET} + echo 'static const char *const multilib_matches_raw[] = { \ + "m64 m64;", "m32 m32;", NULL };' >> ${.TARGET} + echo 'static const char *multilib_options = "m64/m32";' >> ${.TARGET} +.else echo 'static const char *const multilib_raw[] = { \ ". ;", NULL };' > ${.TARGET} echo 'static const char *const multilib_matches_raw[] = { \ NULL };' >> ${.TARGET} - echo 'static const char *multilib_extra = "";' >> ${.TARGET} echo 'static const char *multilib_options = "";' >> ${.TARGET} +.endif + echo 'static const char *multilib_extra = "";' >> ${.TARGET} echo 'static const char *const multilib_exclusions_raw[] = { \ NULL };' >> ${.TARGET}