On Mon, Aug 22, 2011 at 7:06 AM, H.J. Lu <hjl.to...@gmail.com> wrote:
> On Sun, Aug 21, 2011 at 10:37 PM, Jakub Jelinek <ja...@redhat.com> wrote:
>> On Sun, Aug 21, 2011 at 05:09:59PM -0700, H.J. Lu wrote:
>>> I didn't know .init_array section was enabled for AIX.  Does this patch
>>> work for you?
>>
>> Some ELF targets (e.g. arm*-linux*) don't use elfos.h.  IMHO you should
>> instead add
>> #ifndef __ELF__
>> #error NonELF
>> #endif
>> to gcc_AC_INITFINI_ARRAY test.  And/or add another test to it that tests
>> that you can actually use
>> .section .init_array
>> and it will use correct section flags for the section.
>>
>
> I will update the test.

Can I check in this patch to address AIX issue first?
I will submit a patch to test ".section .init_array" later?

Thanks.

-- 
H.J.
---
2011-08-22  H.J. Lu  <hongjiu...@intel.com>

        * acinclude.m4 (gcc_AC_INITFINI_ARRAY): Error if __ELF__ isn't
        defined.

diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index 74c86db..a8ecd2d 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -377,6 +377,9 @@ AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array su
pport,
                 gcc_cv_initfini_array, [dnl
   if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then
     AC_RUN_IFELSE([AC_LANG_SOURCE([
+#ifndef __ELF__
+#error Not an ELF OS
+#endif
 #ifdef __ia64__
 /* We turn on .preinit_array/.init_array/.fini_array support for ia64
    if it can be used.  */

Reply via email to