Go to file
Alexey Brodkin 3e53b51983 package/gcc: enable __cxa_atexit
This is what GCC manual says [1]:
-------------------------->8----------------------
--enable-__cxa_atexit

    Define if you want to use __cxa_atexit, rather than atexit,
    to register C++ destructors for local statics and global objects.

    This is essential for fully standards-compliant handling of destructors,
    but requires __cxa_atexit in libc.

    This option is currently only available on systems with GNU libc
    ...
-------------------------->8----------------------

Important disadvantages of a simple atexit() are that [2]:
-------------------------->8----------------------
1999 C Standard only requires that the implementation support 32
registered functions, although most implementations support many more.

More important it does not deal at all with the ability in most implementations
to remove DSOs from a running program image by calling dlclose
prior to program termination.
-------------------------->8----------------------

Also it seems like all libc's we support in Buildroot (Glibc, uClibc and musl)
support __cxa_at_exit() so enable it unconditionally.

FWIW if we look around we'll see:
 1. In OpenEmbedded it is enabled for everything except gcc-cross-initial: [3], [4]
 2. In Crosstool-NG it is enabled by default: [5]
 3. In OpenWrt it is disabled only for uClibc, otherwise enabled: [6]

So I think we should be good with it as well.

[1] https://gcc.gnu.org/install/configure.html
[2] https://itanium-cxx-abi.github.io/cxx-abi/abi.html#dso-dtor-motivation
[3] https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/gcc/gcc-configure-common.inc#L59
[4] https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/gcc/gcc-cross-initial.inc#L23
[5] https://github.com/crosstool-ng/crosstool-ng/blob/master/config/cc/gcc.in#L270
[6] https://github.com/openwrt/openwrt/blob/master/toolchain/gcc/common.mk#L170

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Nicolas Cavallari <Nicolas.Cavallari@green-communications.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Mark Corbin <mark.corbin@embecosm.com>
Cc: Romain Naour <romain.naour@gmail.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
Cc: Claudiu Zissulescu <claziss@synopsys.com>
Cc: Cupertino Miranda <cmiranda@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-11-29 22:12:38 +01:00
arch arch: drop BR2_GCC_TARGET_CPU_REVISION option 2018-10-01 14:52:32 +02:00
board configs/aarch64_efi_defconfig: new defconfig 2018-11-26 21:11:08 +01:00
boot grub2: add usage notes for grub2 arm and aarch64 2018-11-26 22:11:07 +01:00
configs configs/aarch64_efi_defconfig: new defconfig 2018-11-26 21:11:08 +01:00
docs Update for 2018.11-rc1 2018-11-09 22:56:48 +01:00
fs Makefile: rework main directory creation logic 2018-11-26 19:09:46 +01:00
linux linux: bump default to 4.19.2 2018-11-22 17:37:34 +01:00
package package/gcc: enable __cxa_atexit 2018-11-29 22:12:38 +01:00
support boot/grub2: add option to install tools 2018-11-26 20:59:33 +01:00
system system: update Config.in comment about systemd dependencies 2018-09-15 00:05:48 +02:00
toolchain toolchain: bump ARC prebuild toolchain to arc-2018.09 2018-11-29 21:39:44 +01:00
utils utils/test-pkg: use the correct config prefix when merging 2018-11-24 10:11:13 +01:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.flake8 .flake8: ignore utils/diffconfig 2018-03-13 22:37:54 +01:00
.gitignore update gitignore 2013-05-04 12:41:55 +02:00
.gitlab-ci.yml .gitlab-ci.yml: refresh with aarch64_efi_defconfig 2018-11-26 22:01:44 +01:00
.gitlab-ci.yml.in .gitlab-ci.yml: add trigger per type of job 2018-11-14 09:18:40 +01:00
CHANGES Update for 2018.11-rc1 2018-11-09 22:56:48 +01:00
Config.in core/download: drop the SSH command 2018-11-19 22:11:31 +01:00
Config.in.legacy boot/xloader: remove package 2018-10-26 16:59:05 +02:00
COPYING COPYING: add exception about patch licensing 2016-02-26 19:50:13 +01:00
DEVELOPERS package/grpc: new package 2018-11-29 21:49:50 +01:00
Makefile Makefile: define TARGET_DIR_WARNING_FILE relative to TARGET_DIR 2018-11-26 19:11:19 +01:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README README: add reference to submitting-patches 2016-02-01 19:16:08 +01:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on Freenode IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches