Skip to contentSkip to conversation

: Enable init_array support

PATCH New Vineet Gupta 2 participants 2 messages Jan 29, 2019 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Enable init_array support

gcc's common configure script has a subtle flaw that it only tests {init,fini.preinit}_array support when NOT cross compiling. This causes cross builds to erroneously deduce that the feature is not supported by the target.

| host-gcc-final-ab544139bfee/build/gcc/config.log
|
|configure:22941: checking for .preinit_array/.init_array/.fini_array support
|configure:23106: checking cross compile... guessing
|configure:23111: result: no

The right fix is to enable this for *all* cross setups (and address any fallouts). However in the short-term to enable ARC glibc port to upstream, force enable this for ARC.

This has been discussed at length on glibc mailing list [1], [2]

[1] https://sourceware.org/ml/libc-alpha/2018-11/msg00870.html
[2] https://sourceware.org/ml/libc-alpha/2019-01/msg00656.html

gcc/

2019-xx-xx Vineet Gupta <vgupta at synopsys.com>

* gcc/config.gcc: Force .init_array for ARC

Signed-off-by Vineet Gupta <vgupta at synopsys.com>
---
 gcc/ChangeLog  | 4 ++++
 gcc/config.gcc | 3 +++
 2 files changed, 7 insertions(+)
gcc/ChangeLog +4 -0
index f5872dbeab7c..4c86d5375bcc 100644
@@ -1,3 +1,7 @@
+2019-01-28  Vineet Gupta  <vgupta at synopsys.com>
+
+	* gcc/config.gcc: Force .init_array for ARC
+
 2019-01-28  Jakub Jelinek  <jakub at redhat.com>
 
 	PR middle-end/89002
gcc/config.gcc +3 -0
index a189cb19f633..eef4b4eac918 100644
@@ -1110,6 +1110,9 @@ arc*-*-linux*)
 	case ${with_endian} in
 	big*)	tm_file="arc/big.h ${tm_file}"
 	esac
+	# Force .init_array support.  The configure script cannot always
+	# automatically detect that GAS supports it, yet we require it.
+	gcc_cv_initfini_array=yes
         ;;
 arm-wrs-vxworks|arm-wrs-vxworks7)
 	extra_options="${extra_options} arm/vxworks.opt"
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 : Enable init_array support

2019-xx-xx Vineet Gupta <vgupta at synopsys.com>

* gcc/config.gcc: Force .init_array for ARC

Signed-off-by Vineet Gupta <vgupta at synopsys.com>

---

Hi,

Thank you for your contribution. I'll push it asap.

Cheers,
Claudiu