From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34037 invoked by alias); 13 Feb 2018 21:31:15 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 34016 invoked by uid 89); 13 Feb 2018 21:31:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2769 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Feb 2018 21:31:12 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id AAFF8537; Tue, 13 Feb 2018 22:30:40 +0100 (CET) X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4Do-GorrP6SC; Tue, 13 Feb 2018 22:30:38 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4FDDBDB6.dip0.t-ipconnect.de [79.221.189.182]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id D8620536; Tue, 13 Feb 2018 22:30:37 +0100 (CET) From: Rainer Orth To: David Malcolm Cc: FX , gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Subject: Re: [PATCH] jit: fix link on OS X and Solaris (PR jit/64089 and PR jit/84288) References: <78D7B2DA-5677-4211-9C4E-F7B1B5AB51B5@gmail.com> <1518556781-10049-1-git-send-email-dmalcolm@redhat.com> Date: Mon, 01 Jan 2018 00:00:00 -0000 In-Reply-To: <1518556781-10049-1-git-send-email-dmalcolm@redhat.com> (David Malcolm's message of "Tue, 13 Feb 2018 16:19:41 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-q1/txt/msg00003.txt.bz2 Hi David, > libgccjit fails to link on OS X and Solaris due to jit/Make-lang.in, > due to the assumption there that the linker is GNU ld. Specifically, > jit/Make-lang.in hardcodes the use of two options: --version-script > and -soname. > > * on Darwin, --version-script doesn't seem to exist in the linker, and > it uses -install_name rather than -soname. > > * on Solaris, ld doesn't support --version-script. However, the version > script used for libgccjit.so doesn't use any gld extensions, so one can > just use -M instead. > > This patch fixes these issues by using variables emitted by gcc's "configure" > rather than hardcoding the options in jit/Make-lang.in. > > It's based on the first part of Rainer's patch for PR jit/84288, but I > made the following changes: > * the GNU ld case in configure.ac wasn't setting ld_version_script_option. > I set it to "--version-script" for that case. That's weird: the configure.ac part starts with ld_version_script_option='--version-script' only overriding it in the Solaris case to keep things for other hosts as they were. Besides, I'm pretty sure I tested the patch on Solaris with gas/gld to make certain that combo continues to work as is... > * I moved the: > LD_VERSION_SCRIPT_OPTION = @ld_version_script_option@ > from gcc/jit/Make-lang.in to gcc/Makefile.in, as the Make-lang.in files > aren't substituted, only the gcc/Makefile.in. > Rainer: how did this work for you? It didn't: what I'd attached to the PR was an initial version of the patch in the middle between manually hacking gcc/jit/Make-lang.in and properly autoconfiguring things. > * added LD_SONAME_OPTION, done in the same way > * conditionalized the usage of the options in Make-lang.in to cope with > empty LD_VERSION_SCRIPT_OPTION (as is presumably the case on OS X). > I used ($if condition,then-part[,else-part]) for this. > I had to add a $(COMMA) since the "then-part" contains commas, which > need to be treated as part of the "then-part", rather than separators > for the "else-part". > Hopefully this is compatible with every "make" implementation that we > support. > > Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. > > I lightly tested the not-recognized case by hacking up the configure.ac > (on x86_64-pc-linux-gnu) and verifying that it links, and that a > smoketest of jit.dg/test-factorial works. > > Does this fix the jit linker issues on OS X and Solaris? I'll give it a whirl tomorrow, including the jit-recording.c part of my patch to allow the build to complete. Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University