* [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt
@ 2014-04-25 4:29 Sandra Loosemore
2014-05-05 20:32 ` Ping " Sandra Loosemore
0 siblings, 1 reply; 5+ messages in thread
From: Sandra Loosemore @ 2014-04-25 4:29 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
People are now starting to build quite large programs for nios2-elf and
are running into problems with the small data section getting too large
to be entirely within range for GP-relative addressing with a 16-bit
offset. This architecture doesn't have an indirect addressing mode with
32-bit offsets and doing halfword loads to construct a 32-bit constant
offset with an explicit GP add would be less efficient than a direct
reference to the object residing in the small data section, which is
what -mno-gpopt does.
The range overflow problem is more likely to affect libraries than user
code because of the normal linker allocation strategy, so telling users
to build their code with -mno-gpopt is not terribly helpful in many
cases -- the libraries have to be built with -mno-gpopt, too. That's
what this patch does. It's similar to what is already being done for
mips-sde-elf (see config/mt-sde, in particular).
Altera has identified this as an important fix for their users. After
discussion, we decided a a similar hack for nios2-linux-gnu targets
isn't necessary because most people link against shared libraries instead.
I understand that this patch, although target-specific, needs to be
approved by a global reviewer and then propagated to the sourceware.org
binutils-gdb and newlib repositories as well. So, OK to commit?
-Sandra
[-- Attachment #2: toplevel.log --]
[-- Type: text/x-log, Size: 183 bytes --]
2014-04-24 Sandra Loosemore <sandra@codesourcery.com>
* configure.ac (target_makefile_frag): Set for nios2-*-elf*.
* configure: Regenerated.
config/
* mt-nios2-elf: New file.
[-- Attachment #3: toplevel.patch --]
[-- Type: text/x-patch, Size: 1383 bytes --]
Index: configure.ac
===================================================================
--- configure.ac (revision 209669)
+++ configure.ac (working copy)
@@ -2370,6 +2370,9 @@ case "${target}" in
mips*-*-*linux* | mips*-*-gnu*)
target_makefile_frag="config/mt-mips-gnu"
;;
+ nios2-*-elf*)
+ target_makefile_frag="config/mt-nios2-elf"
+ ;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
target_makefile_frag="config/mt-gnu"
;;
Index: config/mt-nios2-elf
===================================================================
--- config/mt-nios2-elf (revision 0)
+++ config/mt-nios2-elf (revision 0)
@@ -0,0 +1,5 @@
+# We build library code with -mno-gpopt so that it can be linked with
+# larger executables with small-data sections that exceed the 16-bit
+# offset range for GP-relative addressing.
+CFLAGS_FOR_TARGET += -mno-gpopt
+CXXFLAGS_FOR_TARGET += -mno-gpopt
Index: configure
===================================================================
--- configure (revision 209669)
+++ configure (working copy)
@@ -6992,6 +6992,9 @@ case "${target}" in
mips*-*-*linux* | mips*-*-gnu*)
target_makefile_frag="config/mt-mips-gnu"
;;
+ nios2-*-elf*)
+ target_makefile_frag="config/mt-nios2-elf"
+ ;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
target_makefile_frag="config/mt-gnu"
;;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Ping [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt
2014-04-25 4:29 [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt Sandra Loosemore
@ 2014-05-05 20:32 ` Sandra Loosemore
2014-05-13 14:12 ` Ping^2 " Sandra Loosemore
0 siblings, 1 reply; 5+ messages in thread
From: Sandra Loosemore @ 2014-05-05 20:32 UTC (permalink / raw)
To: GCC Patches
Ping!
http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01618.html
-Sandra
^ permalink raw reply [flat|nested] 5+ messages in thread
* Ping^2 [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt
2014-05-05 20:32 ` Ping " Sandra Loosemore
@ 2014-05-13 14:12 ` Sandra Loosemore
2014-05-13 14:20 ` DJ Delorie
2014-05-13 19:06 ` Jeff Law
0 siblings, 2 replies; 5+ messages in thread
From: Sandra Loosemore @ 2014-05-13 14:12 UTC (permalink / raw)
To: GCC Patches
On 05/05/2014 02:32 PM, Sandra Loosemore wrote:
> Ping!
>
> http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01618.html
And ping again....
-Sandra
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Ping^2 [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt
2014-05-13 14:12 ` Ping^2 " Sandra Loosemore
@ 2014-05-13 14:20 ` DJ Delorie
2014-05-13 19:06 ` Jeff Law
1 sibling, 0 replies; 5+ messages in thread
From: DJ Delorie @ 2014-05-13 14:20 UTC (permalink / raw)
To: Sandra Loosemore; +Cc: gcc-patches
> I understand that this patch, although target-specific, needs to be
> approved by a global reviewer
Target-specific fragments of build files are generally approved by the
target maintainer. A global maintainer's approval is not required.
> and then propagated to the sourceware.org binutils-gdb and newlib
> repositories as well.
Yup.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Ping^2 [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt
2014-05-13 14:12 ` Ping^2 " Sandra Loosemore
2014-05-13 14:20 ` DJ Delorie
@ 2014-05-13 19:06 ` Jeff Law
1 sibling, 0 replies; 5+ messages in thread
From: Jeff Law @ 2014-05-13 19:06 UTC (permalink / raw)
To: Sandra Loosemore, GCC Patches
On 05/13/14 08:11, Sandra Loosemore wrote:
> On 05/05/2014 02:32 PM, Sandra Loosemore wrote:
>> Ping!
>>
>> http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01618.html
>
> And ping again....
As a co-maintainer for the nios2 port, I think this would be something
you could self-approve.
Regardless, approved :-)
jeff
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-13 19:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-25 4:29 [patch, toplevel] configure nios2-elf libraries to build with -mno-gpopt Sandra Loosemore
2014-05-05 20:32 ` Ping " Sandra Loosemore
2014-05-13 14:12 ` Ping^2 " Sandra Loosemore
2014-05-13 14:20 ` DJ Delorie
2014-05-13 19:06 ` Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).