From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6084 invoked by alias); 13 Jan 2015 16:59:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6065 invoked by uid 89); 13 Jan 2015 16:59:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Jan 2015 16:59:34 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1YB4oU-0000Uy-Ok from Zach_Welch@mentor.com ; Tue, 13 Jan 2015 08:59:30 -0800 Received: from [127.0.0.1] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Tue, 13 Jan 2015 08:59:30 -0800 Message-ID: <54B54EF2.3050901@codesourcery.com> Date: Tue, 13 Jan 2015 16:59:00 -0000 From: Zach Welch User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Joel Brobecker CC: Subject: Re: [PATCH] Fix gdbserver build with x86_64-w64-mingw32 -m32 References: <1420825778-8946-1-git-send-email-zwelch@codesourcery.com> <20150110041728.GQ5445@adacore.com> <54B40A39.5000106@codesourcery.com> <20150113091706.GB8167@adacore.com> In-Reply-To: <20150113091706.GB8167@adacore.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-SW-Source: 2015-01/txt/msg00349.txt.bz2 On 01/13/2015 01:17 AM, Joel Brobecker wrote: >>> Intuitively, I would say that the proper way to achive a 32bit >>> gdbserver is by configuring it using a 32bit triplet, no? >>> What happens if you do: >>> >>> ./configure --build=i686-pc-mingw32 CFLAGS='-m32' >> >> Actually, I am using i686-pc-linux-gnu as $build. I think you meant to >> ask for --host. I am using --host=x86_64-w64-mingw32 CFLAGS=-m32, which >> is distinctly different than i686-pc-mingw32. For example, they use >> completely different runtime libraries. I think it would be an error to >> conflate the two toolchains. Thus, I stand by my patch as the correct >> solution for this issue. > > Actually, I did mean --build=. This option is meant to override > what the config.guess script would normally guess as being your > operating system. On Windows, at least in my case, config.guess > guesses i686-pc-mingw32, which is not what you want, because it's > cygwin. That's why you need --build=i686-pc-mingw32. > > Unless I misunderstood you, I suspect you're gettting confused by > the meaning of the --host, --build and --target. I believe that you have misunderstood my scenario. The build server's host OS is x86_64-linux-gnu; however, I am using a i686-pc-linux-gnu toolchain (thus, --build=i686-pc-linux-gnu) to produce 32-bit binaries (for maximum portability). I am using that toolchain to build a complete cross toolchain for x86_64-w64-mingw32 (--target). Thus, the primary host for which I am building gdbserver is x86_64-w64-mingw32 (--host=x86_64-w64-mingw32), but I am also using the x86_64-w64-mingw32 toolchain to build a multilib for 32-bit windows (--host=x86_64-w64-mingw32 CFLAGS="-m32") as a secondary host. gdbserver runs on the target (and is not itself a cross compiler), so --host == --target in both cases. The primary host gdbserver build (--host=x86_64-w64-mingw32) works, but the secondary host build (--host=x86_64-w64-mingw32 CFLAGS="-m32") fails without my provided patch. In conclusion, I feel fairly confident that I am using the correct configure options. The i686-pc-mingw32 triplet should not enter into the equation at all in my situation. -- Zach Welch Mentor Graphics Corporation zwelch@codesourcery.com (503) 685-5434