openwrt / openwrt/packages

nfdump can not be compiled with ASLR PIE

Open
#14,188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @flyn-org
Environment: aarch64_cortex-a53 (Turris MOX), OpenWrt master
OpenWrt commit: 36e0268aa67bb757d7b9b39cbe1e7f89332f6746

Issue:

/bin/bash ../libtool  --tag=CC   --mode=link ccache_cc  -g -O3 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing  -L/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/usr/lib -L/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib -fPIC -specs=/foo/build/include/hardened-ld-pie.specs -znow -zrelro -Wl,--as-needed -lfts  -o nfcapd nfcapd-nfcapd.o nfcapd-nfstatfile.o nfcapd-launch.o nfcapd-nfnet.o nfcapd-collector.o nfcapd-netflow_v1.o nfcapd-netflow_v5_v7.o nfcapd-netflow_v9.o nfcapd-ipfix.o nfcapd-bookkeeper.o nfcapd-expire.o  -lnfdump  -lresolv -lbz2
OpenWrt-libtool: link: ccache_cc -g -O3 -std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -fno-strict-aliasing -fPIC -specs=/foo/build/include/hardened-ld-pie.specs -znow -zrelro -Wl,--as-needed -o .libs/nfcapd nfcapd-nfcapd.o nfcapd-nfstatfile.o nfcapd-launch.o nfcapd-nfnet.o nfcapd-collector.o nfcapd-netflow_v1.o nfcapd-netflow_v5_v7.o nfcapd-netflow_v9.o nfcapd-ipfix.o nfcapd-bookkeeper.o nfcapd-expire.o  -L/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/usr/lib -L/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib /foo/build/build_dir/target-aarch64_cortex-a53_musl/nfdump-1.6.22/bin/.libs/libnfdump.so -lfts -lresolv -lbz2
/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.4.0/../../../../aarch64-openwrt-linux-musl/bin/ld: nfcapd-nfcapd.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `optarg' which may bind externally can not be used when making a shared object; recompile with -fPIC
/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.4.0/../../../../aarch64-openwrt-linux-musl/bin/ld: nfcapd-nfcapd.o(.text.startup+0x138): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `optarg'
/foo/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.4.0/../../../../aarch64-openwrt-linux-musl/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the nfdump build on the stated aarch64 OpenWrt environment, focusing on the nfcapd link command and its generated object files. Trace why the nfcapd objects cannot be linked with the hardened-ld-pie.specs settings; done means nfdump compiles successfully with ASLR PIE enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.