From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23988 invoked by alias); 11 Feb 2014 22:36:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 23977 invoked by uid 89); 11 Feb 2014 22:36:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: LUCKMAN.anl.gov Received: from luckman.anl.gov (HELO LUCKMAN.anl.gov) (146.137.81.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 11 Feb 2014 22:36:04 +0000 Received: from localhost (146.137.81.4) by smtp.anl.gov (146.137.81.37) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 11 Feb 2014 16:36:01 -0600 Date: Tue, 11 Feb 2014 22:36:00 -0000 From: Hal Finkel To: Rafael =?utf-8?Q?Esp=C3=ADndola?= CC: Renato Golin , gcc , Jan Hubicka Message-ID: <18958682.1684.1392158155721.JavaMail.javamailuser@localhost> In-Reply-To: Subject: Re: LLVM collaboration? MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1682_28113996.1392158155713" X-SW-Source: 2014-02/txt/msg00149.txt.bz2 ------=_Part_1682_28113996.1392158155713 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-length: 3022 ----- Original Message ----- > From: "Rafael Esp=C3=ADndola" > To: "Jan Hubicka" > Cc: "Renato Golin" , "gcc" , "H= al Finkel" > Sent: Tuesday, February 11, 2014 3:38:40 PM > Subject: Re: Fwd: LLVM collaboration? >=20 > > My reading of bfd/plugin.c is that it basically walks the directory > > and looks > > for first plugin that returns OK for onload. (that is always the > > case for > > GCC/LLVM plugins). So if I instlal GCC and llvm plugin there it > > will > > depend who will end up being first and only that plugin will be > > used. > > > > We need multiple plugin support as suggested by the directory name > > ;) > > > > Also it sems that currently plugin is not used if file is ELF for > > ar/nm/ranlib > > (as mentioned by Markus) and also GNU-ld seems to choke on LLVM > > object files > > even if it has plugin. > > > > This probably needs ot be sanitized. >=20 > CCing Hal Finkel. He got this to work some time ago. Not sure if he > ever ported the patches to bfd trunk. I have a patch for binutils 2.24 (attached -- I think this works, I hand is= olated it from my BG/Q patchset). I would not consider it to be of upstream= quality, but I'd obviously appreciate any assistance on making everything = clean and proper ;) -Hal >=20 > >> For OS X the situation is a bit different. There instead of a > >> plugin > >> the linker loads a library: libLTO.dylib. When doing LTO with a > >> newer > >> llvm, one needs to set DYLD_LIBRARY_PATH. I think I proposed > >> setting > >> that from clang some time ago, but I don't remember the outcome. > >> > >> In theory GCC could implement a libLTO.dylib and set > >> DYLD_LIBRARY_PATH. The gold/bfd plugin that LLVM uses is basically > >> a > >> API mapping the other way, so the job would be inverting it. The > >> LTO > >> model ld64 is a bit more strict about knowing all symbol > >> definitions > >> and uses (including inline asm), so there would be work to be done > >> to > >> cover that, but the simple cases shouldn't be too hard. > > > > I would not care that much about symbols in asm definitions to > > start with. > > Even if we will force users to non-LTO those object files, it would > > be an > > improvement over what we have now. > > > > One problem is that we need a volunteer to implement the reverse > > glue > > (libLTO->plugin API), since I do not have an OS X box (well, have > > an old G5, > > but even that is quite far from me right now) > > > > Why complete symbol tables are required? Can't ld64 be changed to > > ignore > > unresolved symbols in the first stage just like gold/gnu-ld does? >=20 > I am not sure about this. My *guess* is that it does dead stripping > computation before asking libLTO for the object file. I noticed the > issue while trying to LTO firefox some time ago. >=20 > Cheers, > Rafael >=20 --=20 Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory ------=_Part_1682_28113996.1392158155713 Content-Type: text/x-patch; name="binutils-2.24-ld-plugin.patch" Content-Disposition: attachment; filename="binutils-2.24-ld-plugin.patch" Content-Transfer-Encoding: base64 Content-length: 4185 ZGlmZi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9QTFVH SU5TICovCiAKIGJmZF9ib29sZWFuICBsZGZpbGVfYXNzdW1lZF9zY3JpcHQg PSBGQUxTRTsKQEAgLTEyNCw2ICsxMjUsNyBAQCBiZmRfYm9vbGVhbgogbGRm aWxlX3RyeV9vcGVuX2JmZCAoY29uc3QgY2hhciAqYXR0ZW1wdCwKIAkJICAg ICBsYW5nX2lucHV0X3N0YXRlbWVudF90eXBlICplbnRyeSkKIHsKKyAgaW50 IGlzX29iaiA9IDA7CiAgIGVudHJ5LT50aGVfYmZkID0gYmZkX29wZW5yIChh dHRlbXB0LCBlbnRyeS0+dGFyZ2V0KTsKIAogICBpZiAodmVyYm9zZSkKQEAg LTE2OCw2ICsxNzAsMzQgQEAgbGRmaWxlX3RyeV9vcGVuX2JmZCAoY29uc3Qg Y2hhciAqYXR0ZW1wdCwKIAl7CiAJICBpZiAoISBiZmRfY2hlY2tfZm9ybWF0 IChjaGVjaywgYmZkX29iamVjdCkpCiAJICAgIHsKKyNpZmRlZiBFTkFCTEVf UExVR0lOUworCSAgICAgIGlmIChjaGVjayA9PSBlbnRyeS0+dGhlX2JmZAor CQkgICYmIGJmZF9nZXRfZXJyb3IgKCkgPT0gYmZkX2Vycm9yX2ZpbGVfbm90 X3JlY29nbml6ZWQKKwkJICAmJiAhIGxkZW11bF91bnJlY29nbml6ZWRfZmls ZSAoZW50cnkpKQorCQl7CisgICAgICAgICAgICAgICAgICBpZiAocGx1Z2lu X2FjdGl2ZV9wbHVnaW5zX3AgKCkKKyAgICAgICAgICAgICAgICAgICAgICAm JiAhbm9fbW9yZV9jbGFpbWluZykKKyAgICAgICAgICAgICAgICAgICAgewor ICAgICAgICAgICAgICAgICAgICAgIGludCBmZCA9IG9wZW4gKGF0dGVtcHQs IE9fUkRPTkxZIHwgT19CSU5BUlkpOworICAgICAgICAgICAgICAgICAgICAg IGlmIChmZCA+PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAg ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbGRfcGx1Z2luX2lucHV0 X2ZpbGUgZmlsZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICBiZmRf ZWxmX21ha2Vfb2JqZWN0IChlbnRyeS0+dGhlX2JmZCk7CisgCisgICAgICAg ICAgICAgICAgICAgICAgICAgIGZpbGUubmFtZSA9IGF0dGVtcHQ7CisgICAg ICAgICAgICAgICAgICAgICAgICAgIGZpbGUub2Zmc2V0ID0gMDsKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgZmlsZS5maWxlc2l6ZSA9IGxzZWVrIChm ZCwgMCwgU0VFS19FTkQpOworICAgICAgICAgICAgICAgICAgICAgICAgICBm aWxlLmZkID0gZmQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBsdWdp bl9tYXliZV9jbGFpbSAoJmZpbGUsIGVudHJ5KTsKKworICAgICAgICAgICAg ICAgICAgICAgICAgICBpZiAoZW50cnktPmZsYWdzLmNsYWltZWQpCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFRSVUU7CisgICAgICAg ICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAg ICAgICAgICAgICAgICB9CisjZW5kaWYgLyogRU5BQkxFX1BMVUdJTlMgKi8K KwogCSAgICAgIGlmIChjaGVjayA9PSBlbnRyeS0+dGhlX2JmZAogCQkgICYm IGVudHJ5LT5mbGFncy5zZWFyY2hfZGlycwogCQkgICYmIGJmZF9nZXRfZXJy b3IgKCkgPT0gYmZkX2Vycm9yX2ZpbGVfbm90X3JlY29nbml6ZWQKQEAgLTMw Myw3ICszMzMsOSBAQCBzdWNjZXNzOgogICAgICBiZmRfb2JqZWN0IHRoYXQg aXQgc2V0cyB0aGUgYmZkJ3MgYXJjaCBhbmQgbWFjaCwgd2hpY2gKICAgICAg d2lsbCBiZSBuZWVkZWQgd2hlbiBhbmQgaWYgd2Ugd2FudCB0byBiZmRfY3Jl YXRlIGEgbmV3CiAgICAgIG9uZSB1c2luZyB0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