Bug 21040 - Gold fails with GCC 4.2
Summary: Gold fails with GCC 4.2
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.28
: P2 normal
Target Milestone: 2.28
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-11 18:55 UTC by H.J. Lu
Modified: 2017-02-21 23:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2017-01-11 18:55:03 UTC
With GCC 4.2, I got

gold/x86_64.cc:481: error: using ‘typename’ outside of template
...
gold/powerpc.cc:2013: warning: comparison is always false due to limited range of data type
...
gold/testsuite/copy_test_relro_1.cc:24: warning: ‘p’ initialized and declared ‘extern’
Comment 1 Cary Coutant 2017-01-11 19:38:17 UTC
> gold/powerpc.cc:2013: warning: comparison is always false due to limited
> range of data type

Alan, I'll leave this one to you. Not sure whether you want to cast addr to uint64_t or not.
Comment 2 cvs-commit@gcc.gnu.org 2017-01-11 19:48:16 UTC
The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=976e204b369fd01f9d35d87ea2cd07707c3a40cf

commit 976e204b369fd01f9d35d87ea2cd07707c3a40cf
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Wed Jan 11 11:47:27 2017 -0800

    Fix compile errors with GCC 4.2.
    
    gold/
    	PR gold/21040
    	* x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
    	Remove unnecessary 'typename' keyword.
    	(Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
    	* testsuite/copy_test_relro_1.cc (p, b, c, q): Add separate extern
    	declarations.
Comment 3 cvs-commit@gcc.gnu.org 2017-01-11 19:49:03 UTC
The binutils-2_28-branch branch has been updated by Cary Coutant <ccoutant@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=930624ccb207a0e1bb16500a4d812e9671fb78de

commit 930624ccb207a0e1bb16500a4d812e9671fb78de
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Wed Jan 11 11:47:27 2017 -0800

    Fix compile errors with GCC 4.2.
    
    gold/
    	PR gold/21040
    	* x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
    	Remove unnecessary 'typename' keyword.
    	(Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
    	* testsuite/copy_test_relro_1.cc (p, b, c, q): Add separate extern
    	declarations.
Comment 4 cvs-commit@gcc.gnu.org 2017-01-11 21:43:12 UTC
The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6624f3a142811450fab7eed1f406c4a030c3c9be

commit 6624f3a142811450fab7eed1f406c4a030c3c9be
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Wed Jan 11 13:42:24 2017 -0800

    Fix more compile errors with GCC 4.2.
    
    gold/
    	PR gold/21040
    	* x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
    	Remove unnecessary 'typename' keyword.
    	(Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::do_write): Likewise.
Comment 5 cvs-commit@gcc.gnu.org 2017-01-11 21:45:29 UTC
The binutils-2_28-branch branch has been updated by Cary Coutant <ccoutant@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c5cb17ebcfe6d375a7b85dd6014306b1ef473a2f

commit c5cb17ebcfe6d375a7b85dd6014306b1ef473a2f
Author: Cary Coutant <ccoutant@gmail.com>
Date:   Wed Jan 11 13:42:24 2017 -0800

    Fix more compile errors with GCC 4.2.
    
    gold/
    	PR gold/21040
    	* x86_64.cc (Output_data_plt_x86_64_bnd::do_fill_first_plt_entry):
    	Remove unnecessary 'typename' keyword.
    	(Output_data_plt_x86_64_bnd::do_fill_plt_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::fill_aplt_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::do_fill_tlsdesc_entry): Likewise.
    	(Output_data_plt_x86_64_bnd::do_write): Likewise.
Comment 6 cvs-commit@gcc.gnu.org 2017-01-13 15:49:02 UTC
The master branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=857e829e3a0b681c3cd807a307f53f466a332204

commit 857e829e3a0b681c3cd807a307f53f466a332204
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jan 13 07:46:14 2017 -0800

    Gold: Fix build with GCC 4.2
    
    	PR gold/21040
    	* powerpc.cc (Powerpc_relobj<size, big_endian>::make_toc_relative):
    	Cast 0x80008000 to uint64_t.
Comment 7 cvs-commit@gcc.gnu.org 2017-01-13 15:55:54 UTC
The binutils-2_28-branch branch has been updated by H.J. Lu <hjl@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=964f1b32b950a906dbd24ee8805d810c07962153

commit 964f1b32b950a906dbd24ee8805d810c07962153
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jan 13 07:46:14 2017 -0800

    Gold: Fix build with GCC 4.2
    
    	PR gold/21040
    	* powerpc.cc (Powerpc_relobj<size, big_endian>::make_toc_relative):
    	Cast 0x80008000 to uint64_t.
Comment 8 H.J. Lu 2017-01-13 17:03:05 UTC
Fixed for 2.28 and 2.29.
Comment 9 cvs-commit@gcc.gnu.org 2017-02-21 23:33:45 UTC
The binutils-2_27-branch branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c8dbc58e0a9be82937b5875fe53412e260a6cc42

commit c8dbc58e0a9be82937b5875fe53412e260a6cc42
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jan 13 07:46:14 2017 -0800

    Gold: Fix build with GCC 4.2
    
    	PR gold/21040
    	* powerpc.cc (Powerpc_relobj<size, big_endian>::make_toc_relative):
    	Cast 0x80008000 to uint64_t.