summaryrefslogtreecommitdiff
path: root/include/haproxy/initcall.h
Commit message (Collapse)AuthorAgeFilesLines
* BUILD: compiler: use a more portable set of asm(".weak") statementsWilly Tarreau2022-04-141-4/+2
| | | | | | | | | | | | | | | | | | | | The two recent patches b12966af1 ("BUILD: debug: mark the __start_mem_stats/__stop_mem_stats symbols as weak") and 2a06e248f ("BUILD: initcall: mark the __start_i_* symbols as weak, not global") aimed at fixing a build warning and resulted in a build breakage on MacOS which doesn't have a ".weak" asm statement. We've already had MacOS-specific asm() statements for section names, so this patch continues on this trend by moving HA_GLOBL() to compiler.h and using ".globl" on MacOS since apparently nobody complains there. It is debatable whether to expose this only when !USE_OBSOLETE_LINKER or all the time, but since these are just macroes it's no big deal to let them be available when needed and let the caller decide on the build conditions. If any of the patches above is backported, this one will need to as well.
* BUILD: initcall: mark the __start_i_* symbols as weak, not globalWilly Tarreau2022-04-131-1/+1
| | | | | | | | | Just like for previous fix, these symbols are marked ".globl" during their declaration, but their later mention uses __attribute__((weak)), so it's better to only use ".weak" during the declaration so that the symbol's class does not change. No need to backport this unless someone reports build issues.
* MEDIUM: initcall: move STG_REGISTER earlierWilly Tarreau2022-02-231-2/+2
| | | | | | | | | | The STG_REGISTER init level is used to register known keywords and protocol stacks. It must be called earlier because some of the init code already relies on it to be known. For example, "haproxy -vv" for now is constrained to start very late only because of this. This patch moves it between STG_LOCK and STG_ALLOC, which is fine as it's used for static registration.
* MINOR: initcall: Rename __GLOBL and __GLOBL1.Olivier Houchard2021-10-111-4/+4
| | | | | | | Rename __GLOBL and __GLOBL1 to __HA_GLOBL and __HA_GLOBL1, as the former are already defined on FreeBSD. This should be backported to 2.4, 2.3 and 2.2.
* CLEANUP: initcall: rely on HA_SECTION_* instead of defining its ownWilly Tarreau2021-04-101-15/+6
| | | | | Now initcalls are defined using the regular section definitions from compiler.h in order to ease maintenance.
* CLEANUP: initcall: rename HA_SECTION to HA_INIT_SECTIONWilly Tarreau2021-04-101-3/+3
| | | | | The HA_SECTION name is too generic and will be reused globally. Let's rename this one.
* MINOR: initcall: uniformize the section names between MacOS and other unixesWilly Tarreau2021-04-101-8/+8
| | | | | | | | Due to length restrictions on OSX the initcall sections are called "i_" there while they're called "init_" on other OSes. However the start and end of sections are still called "__start_init_" and "__stop_init_", which forces to have distinct code between the OSes. Let's switch everyone to "i_" and rename the symbols accordingly.
* REORG: include: move the base files from common/ to haproxy/Willy Tarreau2020-06-111-0/+268
The files currently covered by api-t.h and api.h (compat, compiler, defaults, initcall) are now located inside haproxy/.