From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11167 invoked by alias); 28 Mar 2014 05:37:04 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 11153 invoked by uid 89); 28 Mar 2014 05:37:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pb0-f52.google.com Received: from mail-pb0-f52.google.com (HELO mail-pb0-f52.google.com) (209.85.160.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 28 Mar 2014 05:37:02 +0000 Received: by mail-pb0-f52.google.com with SMTP id rr13so4516050pbb.39 for ; Thu, 27 Mar 2014 22:37:00 -0700 (PDT) X-Received: by 10.66.190.4 with SMTP id gm4mr6298374pac.116.1395985020100; Thu, 27 Mar 2014 22:37:00 -0700 (PDT) Received: from [192.168.1.7] (58-7-113-85.dyn.iinet.net.au. [58.7.113.85]) by mx.google.com with ESMTPSA id pq3sm17724001pbb.57.2014.03.27.22.36.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 22:36:58 -0700 (PDT) Message-ID: <53350A7C.9040404@gmail.com> Date: Fri, 28 Mar 2014 05:37:00 -0000 From: Kim User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Binutils Development Subject: Configuring ld linker to generate ELF files on Windows for cross compilation to linux 32 & 64bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00290.txt.bz2 Hi guys, I'm trying to set up a cross compilation toolchain targeting linux 32bit and 64bit from windows 7 using clang and ld. I have clang compiling the object files for the linux target just fine but I'm not sure about how to set up the ld build so that it can link to ELF. If I take the object files generated by clang over to linux I can successfully link them but on windows ld gives me a message "invalid file format". Building binutils from mingw I tried: $ configure --target=x86_64-pc-linux And various other targets but none of them seemed to do the trick. Using objdump -i I can see my version of ld supports: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big plugin srec i386 pe-i386 pei-i386 elf32-i386 elf32-little elf32-big ------ srec plugin ------- -------- ---------- elf32-little elf32-big ------ srec While the one on linux has: elf64-x86-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 i386 elf64-x86-64 elf32-i386 elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big i386 pei-x86-64 ---------- ---------- elf64-little elf64-big l1om ---------- elf64-l1om ---------- elf64-little elf64-big k1om ---------- ---------- elf64-k1om elf64-little elf64-big plugin ---------- ---------- ---------- elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-i386 plugin srec symbolsrec i386 elf32-little elf32-big pe-x86-64 pe-i386 ------ srec symbolsrec l1om elf32-little elf32-big --------- ------- ------ srec symbolsrec k1om elf32-little elf32-big --------- ------- ------ srec symbolsrec plugin elf32-little elf32-big --------- ------- ------ srec symbolsrec How do I go about setting this up correctly? Any help is greatly appreciated! Thanks very much, Kim