From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] [WIP] Port feature/native-comp to Windows. Date: Sun, 10 May 2020 12:24:32 -0700 Message-ID: References: <5eb5b953.1c69fb81.a67ce.a764@mx.google.com> <83lfm1hc91.fsf@gnu.org> <83wo5lds87.fsf@gnu.org> <83imh3d840.fsf@gnu.org> <83eerrd4mb.fsf@gnu.org> <83d07bd35c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="67075"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: nicolasbertolo@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 10 21:25:10 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXrZW-000HKm-D1 for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 21:25:10 +0200 Original-Received: from localhost ([::1]:57904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXrZV-0006sx-FC for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 15:25:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXrYz-0006RY-DM for emacs-devel@gnu.org; Sun, 10 May 2020 15:24:37 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:56149) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXrYy-0000dI-8O; Sun, 10 May 2020 15:24:37 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 04AJOWkj017853 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sun, 10 May 2020 19:24:33 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 04AJOWa5020047; Sun, 10 May 2020 12:24:32 -0700 In-Reply-To: <83d07bd35c.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 May 2020 22:02:39 +0300") Received-SPF: pass client-ip=205.166.94.20; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/10 11:24:46 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249704 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: nicolasbertolo@gmail.com, emacs-devel@gnu.org >> Date: Sun, 10 May 2020 11:54:05 -0700 >> >> The embedde driver is just some code some code in libgccjit that act as >> the original gcc executable so has not need to be located. For the >> support libraries is the linker that does that conventionally. >> >> You can even log the ld invocation done by the embedded drive is nothing >> magical. Finally the linker is just the system one. > > But the linker doesn't usually know where to find the libraries, > because the libraries are part of the GCC installation, not of the > Binutils installation. That's why gcc always tells the linker where > to find the libraries, via the -L switch. Try compiling a trivial > program with "gcc -v", and you will see how the linker is invoked: gcc > spoon-feeds it with all the directories on the library search path > (you can see those directories if you invoke "gcc -print-search-paths"). > >> > Sure, but it sounds like knowing what those parameters are is not a >> > simple job. Although I still don't seem to understand why, silly me. >> >> Me too I do not understand why ld is not doing the expected job > > See above. What _I_ don't understand is why cannot libgccjit feed the > linker with the same -L switches that gcc does. To complete, I think it does: here the ouput of the libgccjit driver running -v (this is a local build). ============================= COLLECT_GCC=x86_64-pc-linux-gnu-gcc-10.0.1 COLLECT_LTO_WRAPPER=/home/akrl/libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --disable-bootstrap --enable-checking=release --enable-host-shared --prefix=/home/akrl --enable-languages=c,c++,jit Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.0.1 20200331 (experimental) (GCC) COLLECT_GCC_OPTIONS='-m64' '-shared' '-o' '/tmp/libgccjit-nQRJfi/fake.so' '-fno-use-linker-plugin' '-v' '-mtune=generic' '-march=x86-64' as -v --64 -o /tmp/ccG1nTa8.o /tmp/libgccjit-nQRJfi/fake.s GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30 COMPILER_PATH=/home/akrl/libexec/gcc/x86_64-pc-linux-gnu/10.0.1/:/home/akrl/libexec/gcc/x86_64-pc-linux-gnu/10.0.1/:/home/akrl/libexec/gcc/x86_64-pc-linux-gnu/:/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/:/home/akrl/lib/gcc/x86_64-pc-linux-gnu/ LIBRARY_PATH=/home/akrl/lib/../lib64/:/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/:/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/../../../../lib64/:/lib/x86_64-linux-gnu/:/lib/../lib64/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib64/:/home/akrl/lib/:./:/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-m64' '-shared' '-o' '/tmp/libgccjit-nQRJfi/fake.so' '-fno-use-linker-plugin' '-v' '-mtune=generic' '-march=x86-64' /home/akrl/libexec/gcc/x86_64-pc-linux-gnu/10.0.1/collect2 --eh-frame-hdr -m elf_x86_64 -shared -o /tmp/libgccjit-nQRJfi/fake.so /usr/lib/x86_64-linux-gnu/crti.o /home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/crtbeginS.o -L/home/akrl/lib/../lib64 -L/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1 -L/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/home/akrl/lib -L. -L/home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/../../.. /tmp/ccG1nTa8.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /home/akrl/lib/gcc/x86_64-pc-linux-gnu/10.0.1/crtendS.o /usr/lib/x86_64-linux-gnu/crtn.o COLLECT_GCC_OPTIONS='-m64' '-shared' '-o' '/tmp/libgccjit-nQRJfi/fake.so' '-fno-use-linker-plugin' '-v' '-mtune=generic' '-march=x86-64'