Message ID | cover.1543283180.git.han_mao@c-sky.com |
---|---|
Headers | show |
Series | port C-SKY to glibc | expand |
On Thu, 29 Nov 2018, Mao Han wrote: > It seems quite hard to valuate the effect of remove restriction on > init-array check in gcc configure. We don't know much about what it will > affect, and can not help to verify this on other platform. It's not your responsibility to make sure it works on all other platforms. You should propose the patch to enable initfini-array for cross compilation (subject to the existing tests that currently run in the native case despite being just as valid for cross-compilation), and then if someone discovers a platform supported by GCC, where that compilation test passes but initfini-array support does not work correctly, at that point we can look at the right way to avoid enabling initfini-array support for that target. (There are other ways of ensuring GCC uses initfini-array support unconditionally for a target - look at what's done for Arm EABI, which also uses initfini-array only. But in the first instance, fixing the configure test is the natural thing to do to make this work better for all ELF architectures. In any case, this should be fixed so that GCC gets it right and no special use of --enable-initfini-array is needed in build-many-glibcs.py.)
On Thu, Nov 29, 2018 at 05:16:58PM +0000, Joseph Myers wrote: > (There are other ways of ensuring GCC uses initfini-array support > unconditionally for a target - look at what's done for Arm EABI, which > also uses initfini-array only. But in the first instance, fixing the > configure test is the natural thing to do to make this work better for all > ELF architectures. In any case, this should be fixed so that GCC gets it > right and no special use of --enable-initfini-array is needed in > build-many-glibcs.py.) > We trend to solve this issue like what RISC-V did, force gcc_cv_initfini_array=yes in config.gcc when glibc is built. The first way may take quite a long time to find out what compilation test is required to get things right. We'v got some question about what compilation test should be like for C-SKY. We'v got several other C library do not use init-array at present. When gcc is built first time we are not able to find out whether the C library want init-array or not, if gcc is not rebuilt for C++, init/fini will never be called. Even if gcc is rebuilt, we can not execute test program if it is cross-compiled. We may try to make init-array check in configure work later when we find ways to solve the issues above. Best Regards, Mao Han
On Fri, 30 Nov 2018, Mao Han wrote: > test should be like for C-SKY. We'v got several other C library do not use > init-array at present. When gcc is built first time we are not able init-array is a standard ELF feature. So if an ELF C library does not support it, that's a bug in that library. So defaulting in the compiler to using init-array for ELF is appropriate, unless there is actual information that a particular target OS lacks support (and in particular, defaulting to using init-array is appropriate for the generic bare-metal targets such as *-elf and *-eabi).