Commit c186879
Hackathon User
fix(include_local): remove automatic hpx_main.hpp inclusion from local.hpp
hpx/local.hpp is a convenience umbrella header for the Standard Parallel
Toolkit. It must never include hpx_main.hpp automatically because that
header has observable, TU-wide side effects:
1. On Linux/macOS with HPX_HAVE_DYNAMIC_HPX_MAIN, wrap_main.hpp emits
non-weak *strong* definitions of hpx_start::include_libhpx_wrap and
hpx_start::app_name_libhpx_wrap into every TU that includes it.
These conflict with the definitions in libhpx_wrap.so and cause
'multiple definition' linker errors in distributed-runtime builds
(e.g. the 18-contracts-lcos_local CI job).
2. Without HPX_HAVE_DYNAMIC_HPX_MAIN (static linking, Windows), it
executes '#define main hpx_startup::user_main', which silently
renames the program entry point in every TU and breaks test
executables that define their own main().
Both issues require that hpx_main.hpp remain an *explicit* user opt-in,
included only in the single translation unit that owns the program's
entry point. An umbrella convenience header is the wrong place for it.
Also remove the now-redundant #define HPX_NO_MAIN guard from the
local_header unit test since local.hpp no longer includes hpx_main.hpp.
Refs: #7070
Signed-off-by: shivansh023023 <singhshivansh023@gmail.com>1 parent fb114de commit c186879
2 files changed
Lines changed: 14 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 14 | | |
19 | 15 | | |
20 | 16 | | |
| |||
0 commit comments