From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14082 invoked by alias); 8 Oct 2014 18:42:38 -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 14072 invoked by uid 89); 8 Oct 2014 18:42:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout27.012.net.il Received: from mtaout27.012.net.il (HELO mtaout27.012.net.il) (80.179.55.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Oct 2014 18:42:35 +0000 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0ND5005002E2SO00@mtaout27.012.net.il> for gdb-patches@sourceware.org; Wed, 08 Oct 2014 21:37:14 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0ND500KCM2E2IS90@mtaout27.012.net.il>; Wed, 08 Oct 2014 21:37:14 +0300 (IDT) Date: Wed, 08 Oct 2014 18:42:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH v2 14/14] the "compile" command In-reply-to: <20141008174431.GB17704@host2.jankratochvil.net> To: Jan Kratochvil Cc: tromey@redhat.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83wq8aies9.fsf@gnu.org> References: <1403279874-23781-1-git-send-email-tromey@redhat.com> <1403279874-23781-15-git-send-email-tromey@redhat.com> <83fvizqtlq.fsf@gnu.org> <20141008174431.GB17704@host2.jankratochvil.net> X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00166.txt.bz2 > Date: Wed, 8 Oct 2014 19:44:31 +0200 > From: Jan Kratochvil > Cc: Tom Tromey , gdb-patches@sourceware.org > > > > + /* Override flags possibly coming from DW_AT_producer. */ > > > + compile_args = xstrdup ("-O0 -gdwarf-4" > > > > This cannot be a fixed setting, I think. E.g., MinGW compilers barf > > when they see -gdwarf-4. > > I have to disagree, -gdwarf-4 works for me. One needs to build new GCC for > libcc1.so anyway. > > $ for i in x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc;do $i --version|head -n1;echo 'main(){}'|$i -gdwarf-4 -x c -;file a.exe;objdump -Wi a.exe|egrep 'Version:|DW_AT_comp_dir'|grep -B1 /tmp|head -n1;done > x86_64-w64-mingw32-gcc (GCC) 4.8.3 20140522 (Fedora MinGW 4.8.3-1.fc20) > a.exe: PE32+ executable (console) x86-64, for MS Windows > Version: 4 > i686-w64-mingw32-gcc (GCC) 4.8.3 20140522 (Fedora MinGW 4.8.3-1.fc20) > a.exe: PE32 executable (console) Intel 80386, for MS Windows > Version: 4 > > > > > + /* We use -fPIC to ensure that we can reference properly. Otherwise > > > + on x86-64 a string constant's address might be truncated when gdb > > > + loads the object; another approach would be -mcmodel=large, but > > > + -fPIC seems more portable across back ends. */ > > > + " -fPIC" > > > + /* We don't want warnings. */ > > > + " -w" > > > + /* Override CU's possible -fstack-protector-strong. */ > > > + " -fno-stack-protector" > > > > Likewise: these are architecture dependent switches, they cannot be > > fixed constants, I think. > > These options work for me for x86_64-w64-mingw32-gcc and i686-w64-mingw32-gcc. AFAIK, MinGW compilers simply ignore -fPIC. But if the feature will only work with these options and no others, then I guess it's OK to have them as fixed strings. Thanks, the documentation parts are OK.