From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101503 invoked by alias); 27 Apr 2015 09:55:42 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 101032 invoked by uid 48); 27 Apr 2015 09:55:37 -0000 From: "jvb at cyberscience dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/64919] bootstrap failure of gcc-4.9.2 on ia64-hpux in libgcc Date: Mon, 27 Apr 2015 09:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jvb at cyberscience dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg02260.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64919 John Buddery changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jvb at cyberscience dot com --- Comment #6 from John Buddery --- I had this issue as well, and here is the solution I used in case anyone is still interested. I believe it is caused by an HP-UX linker bug, the same one described by this comment and workaround in config/ia64/hpux.h: /* The HP-UX linker has a bug that causes calls from functions in .text.unlikely to functions in .text to cause a segfault. Until it is fixed, prevent code from being put into .text.unlikely or .text.hot. */ #define TARGET_ASM_FUNCTION_SECTION ia64_hpux_function_section While this workaround is sufficient for C code, unfortunately g++ can use multiple text sections for various different reasons when compiling c++ code (lookup Vague Linkage for details). This means g++ is broken on HP ia64, and gcc 4.8.0 build using g++, which is why the bootstrap now fails. The workaround I applied was to add the line: #undef MAKE_DECL_ONE_ONLY to gcc/config/ia64/hpux.h, below the lines I referenced above. This seems to prevent gcc from using .linkonce.t sections, and keeps the HP-UX linker happy. I've no idea if this is the correct solution, but it does produce a working g++. Unfortunately just applying this edit you your 4.9.2 sources and building isn't good enough, because it's your existing broken g++ which does the stage1 build. As far as I can tell all g++ versions available for download are broken, so you have to first download and build 4.7.4 or earlier, applying the same gcc/config/ia64/hpux.h as above. This version builds with gcc, not g++, so the bootstrap isn't a problem. Once you have a fixed 4.7.4 g++, you can then use that to bootstrap 4.9.2 - after again apply the hpux.h edit to the 4.9.2 sources. In my case when building 4.9.2 I also had to disable libgomp, but I think that's a different issue. Of course a much better solution to all this would be to get a fixed HP linker; but I can't even tell if any of the HP patches help as they don't seem to make these fixes generally available.