Skip to content

Fix linker error when compiling w/o optimization#2850

Merged
DL6ER merged 1 commit into
pi-hole:developmentfrom
aeolio:escapeVelocity
Apr 15, 2026
Merged

Fix linker error when compiling w/o optimization#2850
DL6ER merged 1 commit into
pi-hole:developmentfrom
aeolio:escapeVelocity

Conversation

@aeolio

@aeolio aeolio commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

What does this PR aim to accomplish?:

Compiling Pi-hole FTL w/o optimization (release type DEBUG) results in the following error during linking:

host/x86_64-buildroot-linux-uclibc/bin/ld: tools/CMakeFiles/tools.dir/dhcp-discover.c.o: in function `create_dhcp_socket':
build/pihole-ftl-6.6/src/tools/dhcp-discover.c:88:(.text+0xac): undefined reference to `start_lock'
host/x86_64-buildroot-linux-uclibc/bin/ld: build/pihole-ftl-6.6/src/tools/dhcp-discover.c:90:(.text+0xe9): undefined reference to `end_lock'
[...]
host/x86_64-buildroot-linux-uclibc/bin/ld: tools/CMakeFiles/tools.dir/dhcpv6-discover.c.o: in function `recv_adv':
build/pihole-ftl-6.6/src/tools/dhcpv6-discover.c:706:(.text+0x137f): undefined reference to `start_lock'
host/x86_64-buildroot-linux-uclibc/bin/ld: build/pihole-ftl-6.6/src/tools/dhcpv6-discover.c:709:(.text+0x13b1): undefined reference to `end_lock'
[...]

When generating code without optimization, gcc ignores the inline directive. Code for this function is generated once, but not marked as global (because the extern keyword is missing), which results in the observed linker error for all other compilation units.

How does this PR accomplish the above?:

Change the function definition to static inline, which will force the compiler to include a static copy of the function in every compilation unit, if the function is not inlined.

Link documentation PRs if any are needed to support this PR:

n/a


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

Compiling Pi-hole FTL w/o optimization (release type "DEBUG") results in
the following error during linking:

'''
x86_64-buildroot-linux-uclibc/bin/ld: tools/CMakeFiles/tools.dir/dhcp-discover.c.o: in function `create_dhcp_socket':
/home/data/buildroot.experimental/build/pihole-ftl-6.6/src/tools/dhcp-discover.c:88:(.text+0xac): undefined reference to `start_lock'
x86_64-buildroot-linux-uclibc/bin/ld: /home/data/buildroot.experimental/build/pihole-ftl-6.6/src/tools/dhcp-discover.c:90:(.text+0xe9): undefined reference to `end_lock'
[...]
x86_64-buildroot-linux-uclibc/bin/ld: tools/CMakeFiles/tools.dir/dhcpv6-discover.c.o: in function `recv_adv':
/home/data/buildroot.experimental/build/pihole-ftl-6.6/src/tools/dhcpv6-discover.c:706:(.text+0x137f): undefined reference to `start_lock'
x86_64-buildroot-linux-uclibc/bin/ld: /home/data/buildroot.experimental/build/pihole-ftl-6.6/src/tools/dhcpv6-discover.c:709:(.text+0x13b1): undefined reference to `end_lock'
[...]
'''

When generating code without optimization, gcc ignores the inline
directive. Code for this function is generated once, but not marked
as global (because the extern keyword is missing), which results
in the observed linker error for all other compilation units.

Change the function definition to static inline, which will force the
compiler to include a static copy of the function in every compilation
unit, if the function is not inlined.

Signed-off-by: Andreas Ziegler <15275159+aeolio@users.noreply.github.com>
@aeolio aeolio requested a review from a team as a code owner April 15, 2026 07:04
@DL6ER DL6ER merged commit 2a88e27 into pi-hole:development Apr 15, 2026
12 checks passed
@DL6ER

DL6ER commented Apr 15, 2026

Copy link
Copy Markdown
Member

Thank you!

@PromoFaux PromoFaux mentioned this pull request Apr 24, 2026
@pralor-bot

Copy link
Copy Markdown

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v6-6-1-and-core-v6-4-2-released/85843/1

github-actions Bot pushed a commit to bigbeartechworld/big-bear-universal-apps that referenced this pull request Apr 25, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [pihole/pihole](https://redirect.github.com/pi-hole/docker-pi-hole) | patch | `2026.04.0` → `2026.04.1` |

---

### Release Notes

<details>
<summary>pi-hole/docker-pi-hole (pihole/pihole)</summary>

### [`v2026.04.1`](https://redirect.github.com/pi-hole/docker-pi-hole/releases/tag/2026.04.1)

[Compare Source](https://redirect.github.com/pi-hole/docker-pi-hole/compare/2026.04.0...2026.04.1)

<!-- Release notes generated using configuration in .github/release.yml at master -->

##### What's Changed

- docs: update capability documentation links by [@&#8203;SirRGB](https://redirect.github.com/SirRGB) in [#&#8203;2025](https://redirect.github.com/pi-hole/docker-pi-hole/pull/2025)

##### New Contributors

- [@&#8203;SirRGB](https://redirect.github.com/SirRGB) made their first contribution in [#&#8203;2025](https://redirect.github.com/pi-hole/docker-pi-hole/pull/2025)

**Full Changelog**: <pi-hole/docker-pi-hole@2026.04.0...2026.04.1>

##### New component versions included in this tag:

##### What's Changed (FTL v6.6.1)

- Add new `GET /api/config/_properties` endpoint by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2356](https://redirect.github.com/pi-hole/FTL/pull/2356)
- Fix thread-safety issues causing SIGSEGV under concurrent API load by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2835](https://redirect.github.com/pi-hole/FTL/pull/2835)
- fix: fix rare race condition for SHM strings in API handlers by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2833](https://redirect.github.com/pi-hole/FTL/pull/2833)
- Accept punycode domains that libidn2 rejects under IDNA2008 by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2838](https://redirect.github.com/pi-hole/FTL/pull/2838)
- Improve shutdown diagnostics to identify SIGTERM source by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2839](https://redirect.github.com/pi-hole/FTL/pull/2839)
- Resolve empty backtraces when addr2line is not installed by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2831](https://redirect.github.com/pi-hole/FTL/pull/2831)
- Improve thread-safety for concurrent API requests by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2847](https://redirect.github.com/pi-hole/FTL/pull/2847)
- Don't skip device lookup when resolver.macNames is disabled by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2846](https://redirect.github.com/pi-hole/FTL/pull/2846)
- Fix linker error when compiling w/o optimization by [@&#8203;aeolio](https://redirect.github.com/aeolio) in [pi-hole/FTL#2850](https://redirect.github.com/pi-hole/FTL/pull/2850)
- Clarify `dns.blockESNI` wording by [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) in [pi-hole/FTL#2784](https://redirect.github.com/pi-hole/FTL/pull/2784)
- Preserve log file path config when fopen fails by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2834](https://redirect.github.com/pi-hole/FTL/pull/2834)

##### Security advisories

- <GHSA-6w8x-p785-6pm4>
  - Fixed with : [pi-hole/FTL@`88c569a`](https://redirect.github.com/pi-hole/FTL/commit/88c569aa026d905d0066135bb71f36a13acf4bf4) and [pi-hole/pi-hole@`7ccb8dd`](https://redirect.github.com/pi-hole/pi-hole/commit/7ccb8ddfb085479fa96e801886eb1cdbeaf3a720)
- <GHSA-9cqv-839p-gpq2>
  - Fixed with : [pi-hole/FTL@`0c46e4e`](https://redirect.github.com/pi-hole/FTL/commit/0c46e4ec7fe57f762fce261625f2cf5d43806e6d)

##### New Contributors

- [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) made their first contribution in [pi-hole/FTL#2784](https://redirect.github.com/pi-hole/FTL/pull/2784)

**Full Changelog**: <pi-hole/FTL@v6.6...v6.6.1>

##### What's Changed (Core v6.4.2)

- Wipe version file before creating a new one by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6538](https://redirect.github.com/pi-hole/pi-hole/pull/6538)
- Fix ownership permissions for containing directories in fix\_owner\_per… by [@&#8203;PromoFaux](https://redirect.github.com/PromoFaux) in [pi-hole/pi-hole#6589](https://redirect.github.com/pi-hole/pi-hole/pull/6589)
- Remove reference to /usr/local/bin/COL\_TABLE by [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) in [pi-hole/pi-hole#6594](https://redirect.github.com/pi-hole/pi-hole/pull/6594)
- Skip apt cache update when pihole-meta is current by [@&#8203;PromoFaux](https://redirect.github.com/PromoFaux) in [pi-hole/pi-hole#6581](https://redirect.github.com/pi-hole/pi-hole/pull/6581)
- Set versions in /etc/pihole/versions to null if script fails by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6550](https://redirect.github.com/pi-hole/pi-hole/pull/6550)
- Remove redundant touching of logfiles from systemd Service by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6601](https://redirect.github.com/pi-hole/pi-hole/pull/6601)
- Loosen requirements for local file access for gravity by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6430](https://redirect.github.com/pi-hole/pi-hole/pull/6430)
- Fix permission for \*.etag files after gravity run by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6353](https://redirect.github.com/pi-hole/pi-hole/pull/6353)
- add logrotate to DEB and RPM dependencies by [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) in [pi-hole/pi-hole#6524](https://redirect.github.com/pi-hole/pi-hole/pull/6524)
- Improve gravity error message including curl exit code and errormsg by [@&#8203;rdwebdesign](https://redirect.github.com/rdwebdesign) in [pi-hole/pi-hole#6605](https://redirect.github.com/pi-hole/pi-hole/pull/6605)

##### Security advisories

- <GHSA-6w8x-p785-6pm4>
  - Fixed with : [pi-hole/pi-hole@`7ccb8dd`](https://redirect.github.com/pi-hole/pi-hole/commit/7ccb8ddfb085479fa96e801886eb1cdbeaf3a720) and [pi-hole/FTL@`88c569a`](https://redirect.github.com/pi-hole/FTL/commit/88c569aa026d905d0066135bb71f36a13acf4bf4)

**Full Changelog**: <pi-hole/pi-hole@v6.4.1...v6.4.2>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bigbeartechworld/big-bear-universal-apps).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNDEuMyIsInVwZGF0ZWRJblZlciI6IjQzLjE0MS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->
github-actions Bot pushed a commit to bigbeartechworld/big-bear-universal-apps that referenced this pull request Apr 25, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jacklul/pihole](https://redirect.github.com/pi-hole/docker-pi-hole) | patch | `2026.04.0` → `2026.04.1` |

---

### Release Notes

<details>
<summary>pi-hole/docker-pi-hole (jacklul/pihole)</summary>

### [`v2026.04.1`](https://redirect.github.com/pi-hole/docker-pi-hole/releases/tag/2026.04.1)

[Compare Source](https://redirect.github.com/pi-hole/docker-pi-hole/compare/2026.04.0...2026.04.1)

<!-- Release notes generated using configuration in .github/release.yml at master -->

#### What's Changed

- docs: update capability documentation links by [@&#8203;SirRGB](https://redirect.github.com/SirRGB) in [#&#8203;2025](https://redirect.github.com/pi-hole/docker-pi-hole/pull/2025)

#### New Contributors

- [@&#8203;SirRGB](https://redirect.github.com/SirRGB) made their first contribution in [#&#8203;2025](https://redirect.github.com/pi-hole/docker-pi-hole/pull/2025)

**Full Changelog**: <pi-hole/docker-pi-hole@2026.04.0...2026.04.1>

#### New component versions included in this tag:

#### What's Changed (FTL v6.6.1)

- Add new `GET /api/config/_properties` endpoint by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2356](https://redirect.github.com/pi-hole/FTL/pull/2356)
- Fix thread-safety issues causing SIGSEGV under concurrent API load by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2835](https://redirect.github.com/pi-hole/FTL/pull/2835)
- fix: fix rare race condition for SHM strings in API handlers by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2833](https://redirect.github.com/pi-hole/FTL/pull/2833)
- Accept punycode domains that libidn2 rejects under IDNA2008 by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2838](https://redirect.github.com/pi-hole/FTL/pull/2838)
- Improve shutdown diagnostics to identify SIGTERM source by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2839](https://redirect.github.com/pi-hole/FTL/pull/2839)
- Resolve empty backtraces when addr2line is not installed by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2831](https://redirect.github.com/pi-hole/FTL/pull/2831)
- Improve thread-safety for concurrent API requests by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2847](https://redirect.github.com/pi-hole/FTL/pull/2847)
- Don't skip device lookup when resolver.macNames is disabled by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2846](https://redirect.github.com/pi-hole/FTL/pull/2846)
- Fix linker error when compiling w/o optimization by [@&#8203;aeolio](https://redirect.github.com/aeolio) in [pi-hole/FTL#2850](https://redirect.github.com/pi-hole/FTL/pull/2850)
- Clarify `dns.blockESNI` wording by [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) in [pi-hole/FTL#2784](https://redirect.github.com/pi-hole/FTL/pull/2784)
- Preserve log file path config when fopen fails by [@&#8203;DL6ER](https://redirect.github.com/DL6ER) in [pi-hole/FTL#2834](https://redirect.github.com/pi-hole/FTL/pull/2834)

#### Security advisories

- <GHSA-6w8x-p785-6pm4>
  - Fixed with : [pi-hole/FTL@`88c569a`](https://redirect.github.com/pi-hole/FTL/commit/88c569aa026d905d0066135bb71f36a13acf4bf4) and [pi-hole/pi-hole@`7ccb8dd`](https://redirect.github.com/pi-hole/pi-hole/commit/7ccb8ddfb085479fa96e801886eb1cdbeaf3a720)
- <GHSA-9cqv-839p-gpq2>
  - Fixed with : [pi-hole/FTL@`0c46e4e`](https://redirect.github.com/pi-hole/FTL/commit/0c46e4ec7fe57f762fce261625f2cf5d43806e6d)

#### New Contributors

- [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) made their first contribution in [pi-hole/FTL#2784](https://redirect.github.com/pi-hole/FTL/pull/2784)

**Full Changelog**: <pi-hole/FTL@v6.6...v6.6.1>

#### What's Changed (Core v6.4.2)

- Wipe version file before creating a new one by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6538](https://redirect.github.com/pi-hole/pi-hole/pull/6538)
- Fix ownership permissions for containing directories in fix\_owner\_per… by [@&#8203;PromoFaux](https://redirect.github.com/PromoFaux) in [pi-hole/pi-hole#6589](https://redirect.github.com/pi-hole/pi-hole/pull/6589)
- Remove reference to /usr/local/bin/COL\_TABLE by [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) in [pi-hole/pi-hole#6594](https://redirect.github.com/pi-hole/pi-hole/pull/6594)
- Skip apt cache update when pihole-meta is current by [@&#8203;PromoFaux](https://redirect.github.com/PromoFaux) in [pi-hole/pi-hole#6581](https://redirect.github.com/pi-hole/pi-hole/pull/6581)
- Set versions in /etc/pihole/versions to null if script fails by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6550](https://redirect.github.com/pi-hole/pi-hole/pull/6550)
- Remove redundant touching of logfiles from systemd Service by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6601](https://redirect.github.com/pi-hole/pi-hole/pull/6601)
- Loosen requirements for local file access for gravity by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6430](https://redirect.github.com/pi-hole/pi-hole/pull/6430)
- Fix permission for \*.etag files after gravity run by [@&#8203;yubiuser](https://redirect.github.com/yubiuser) in [pi-hole/pi-hole#6353](https://redirect.github.com/pi-hole/pi-hole/pull/6353)
- add logrotate to DEB and RPM dependencies by [@&#8203;darkexplosiveqwx](https://redirect.github.com/darkexplosiveqwx) in [pi-hole/pi-hole#6524](https://redirect.github.com/pi-hole/pi-hole/pull/6524)
- Improve gravity error message including curl exit code and errormsg by [@&#8203;rdwebdesign](https://redirect.github.com/rdwebdesign) in [pi-hole/pi-hole#6605](https://redirect.github.com/pi-hole/pi-hole/pull/6605)

#### Security advisories

- <GHSA-6w8x-p785-6pm4>
  - Fixed with : [pi-hole/pi-hole@`7ccb8dd`](https://redirect.github.com/pi-hole/pi-hole/commit/7ccb8ddfb085479fa96e801886eb1cdbeaf3a720) and [pi-hole/FTL@`88c569a`](https://redirect.github.com/pi-hole/FTL/commit/88c569aa026d905d0066135bb71f36a13acf4bf4)

**Full Changelog**: <pi-hole/pi-hole@v6.4.1...v6.4.2>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/bigbeartechworld/big-bear-universal-apps).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNDEuMyIsInVwZGF0ZWRJblZlciI6IjQzLjE0MS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->
@aeolio aeolio deleted the escapeVelocity branch May 26, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants