From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28378 invoked by alias); 19 Nov 2014 10:09:10 -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 28366 invoked by uid 89); 19 Nov 2014 10:09:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 19 Nov 2014 10:09:07 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAJA8wsP007477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 19 Nov 2014 05:08:58 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAJA8tii003520; Wed, 19 Nov 2014 05:08:56 -0500 Message-ID: <546C6C36.9010306@redhat.com> Date: Wed, 19 Nov 2014 10:09:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii , Joel Brobecker CC: yao@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [PATCH] Don't set CC in config/i386/go32.mh References: <1416041503-29957-1-git-send-email-yao@codesourcery.com> <83y4rcg7ns.fsf@gnu.org> <20141115101405.GE5774@adacore.com> <83r3x4g2bv.fsf@gnu.org> In-Reply-To: <83r3x4g2bv.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-11/txt/msg00439.txt.bz2 On 11/15/2014 10:55 AM, Eli Zaretskii wrote: >> Date: Sat, 15 Nov 2014 14:14:05 +0400 >> From: Joel Brobecker >> Cc: Yao Qi , gdb-patches@sourceware.org >> >>> Who will set it to GCC when GDB is compiled natively for >>> i586-pc-msdosdjgpp? >> >> It should already be set. See gdb/Makefile.in where CC is set to >> @CC@, which means CC is what the configure script determines it >> should be, based on how GDB is being configured. >> >> I agree with Yao's patch. Forcing CC to gcc like this seems odd, >> and definitely breaks cross-building to that host. > > How come this never came up before, then? AFAIR, Pedro built the > DJGPP port several times. I did, but I always saw a related problem that I had never tracked down, which very much sounds like fixed by this. >From https://sourceware.org/ml/gdb-patches/2013-05/msg00057.html: ~~~~~~~ Another issue is that in the gdb/Makefile, I end up with CC set twice: $ grep "^CC.*gcc" Makefile CC=i586-pc-msdosdjgpp-gcc CC= gcc and the second one is of course, wrong. configure does find i586-pc-msdosdjgpp-gcc: ... checking for i586-pc-msdosdjgpp-gcc... i586-pc-msdosdjgpp-gcc checking for C compiler default output file name... a.out ... and I don't get this on the other subdirs (bfd, etc.) So if I cd into build/gdb and do "make", the system gcc instead of the djgpp gcc is invoked: $ make make[1]: Entering directory `/home/pedro/gdb/mygit/build-djgpp-2/gdb' ... gcc -g -O2 -I../../src/gdb/config/djgpp -I. -I../../src/gdb -I../../src/gdb/common -I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../opcodes/.. -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../libdecnumber -I../../src/gdb/../libdecnumber -I./../intl -I../../src/gdb/gnulib/import -Ibuild-gnulib/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o init.o -MT init.o -MMD -MP -MF .deps/init.Tpo init.c rm -f gdb.exe gcc -g -O2 -I../../src/gdb/config/djgpp -static-libstdc++ -static-libgcc \ -o gdb.exe gdb.o i386-tdep.o i387-tdep.o ser-go32.o go32-nat.o i386-nat.o remote.o dcache.o tracepoint.o ax-general.o ax-gdb.o remote-fileio.o remote-notif.o ctf.o cli-dump.o cli-decode.o cli-script.o cli-cmds.o cli-setshow.o cli-logging.o cli-interp.o cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-catch.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o mi-cmd-file.o mi-cmd-disas.o mi-symbol-cmds.o mi-cmd-target.o mi-cmd-info.o mi-interp.o mi-main.o mi-parse.o mi-getopt.o python.o py-value.o py-prettyprint.o py-auto-load.o posix-hdep.o c-exp.o cp-name-parser.o ada-exp.o jv-exp.o f-exp.o go-exp.o m2-exp.o p-exp.o version.o annotate.o addrmap.o auto-load.o auxv.o agent.o bfd-target.o blockframe.o breakpoint.o break-catch-sig.o break-catch-throw.o findvar.o regcache.o cleanups.o charset.o continuations.o corelow.o disasm.o dummy-frame.o dfp.o source.o value.o eval.o valops.o valarith.o valprint.o printcmd.o block.o symtab.o psymtab.o symfile.o symmisc.o lin! espec.o dictionary.o infcall.o infcmd.o infrun.o expprint.o environ.o stack.o thread.o exceptions.o filesystem.o filestuff.o inf-child.o interps.o minidebug.o main.o macrotab.o macrocmd.o macroexp.o macroscope.o mi-common.o event-loop.o event-top.o inf-loop.o completer.o gdbarch.o arch-utils.o gdbtypes.o gdb_bfd.o gdb_obstack.o osabi.o copying.o memattr.o mem-break.o target.o parse.o language.o buildsym.o findcmd.o std-regs.o signals.o exec.o reverse.o bcache.o objfiles.o observer.o minsyms.o maint.o demangle.o dbxread.o coffread.o coff-pe-read.o dwarf2read.o mipsread.o stabsread.o corefile.o dwarf2expr.o dwarf2loc.o dwarf2-frame.o dwarf2-frame-tailcall.o ada-lang.o c-lang.o d-lang.o f-lang.o objc-lang.o ada-tasks.o ada-varobj.o ui-out.o cli-out.o varobj.o vec.o go-lang.o go-valprint.o go-typeprint.o jv-lang.o jv-valprint.o jv-typeprint.o m2-lang.o opencl-lang.o p-lang.o p-typeprint.o p-valprint.o sentinel-frame.o complaints.o typeprint.o ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o ada-valprint.o c-valprint.o cp-valprint.o d-valprint.o f-valprint.o m2-valprint.o serial.o mdebugread.o top.o utils.o ui-file.o user-regs.o frame.o frame-unwind.o doublest.o frame-base.o inline-frame.o gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o cp-namespace.o reggroups.o regset.o trad-frame.o tramp-frame.o solib.o solib-target.o prologue-value.o memory-map.o memrange.o xml-support.o xml-syscall.o xml-utils.o target-descriptions.o target-memory.o xml-tdesc.o xml-builtin.o inferior.o osdata.o gdb_usleep.o record.o record-full.o gcore.o gdb_vecs.o jit.o progspace.o skip.o probe.o common-utils.o buffer.o ptid.o gdb-dlfcn.o common-agent.o format.o registry.o btrace.o record-btrace.o inflow.o init.o \ ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ./../intl/libintl.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -ldbg -lm ../libiberty/libiberty.a build-gnulib/import/libgnu.a gdb.o: file not recognized: File format not recognized collect2: error: ld returned 1 exit status make: *** [gdb.exe] Error 1 and that of course isn't the right compiler to use, and things fall apart. When make is invoked from the top build dir, the correct CC is passed down to the gdb/ sub make, so the workaround is to "cd ..; make". ~~~~~~~ Thanks, Pedro Alves