Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols in libiperf when building for ARMv6 #1611

Closed
jpalus opened this issue Dec 3, 2023 · 2 comments · Fixed by #1612
Closed

Undefined symbols in libiperf when building for ARMv6 #1611

jpalus opened this issue Dec 3, 2023 · 2 comments · Fixed by #1612
Assignees

Comments

@jpalus
Copy link
Contributor

jpalus commented Dec 3, 2023

Context

  • Version of iperf3: 3.16

  • Hardware: ARMv6

  • Operating system (and distribution, if any): PLD Linux

Bug Report

  • Expected Behavior

libiperf does not have unresolved symbols.

  • Actual Behavior

libiperf has unresolved symbols related to 64-bit atomics:

	__atomic_store_8
	__atomic_load_8
	__atomic_fetch_add_8
  • Steps to Reproduce
  1. Compile iperf targetting ARMv6
  • Possible Solution

Link libatomic

@bmah888
Copy link
Contributor

bmah888 commented Dec 4, 2023

Thanks for the issue and the PR!

@jpalus jpalus changed the title Undefined symbols in libperf when building for ARMv6 Undefined symbols in libiperf when building for ARMv6 Dec 10, 2023
@jpalus
Copy link
Contributor Author

jpalus commented Dec 15, 2023

Just for reference sample reproducer with podman and alpine (feel free to replace with docker and your favorite 32-bit x86 distribution):

$ podman run --rm -i --arch i386 docker.io/alpine sh <<EOF
apk add gcc musl-dev make
cd /tmp
wget -O - https://github.com/esnet/iperf/releases/download/3.16/iperf-3.16.tar.gz | tar zxf -
cd iperf-3.16
./configure CFLAGS="-march=i386"
make -j$(nproc)
EOF

Gives:

...
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_store_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_load_8'
collect2: error: ld returned 1 exit status
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_store_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_load_8'
make[2]: *** [Makefile:893: t_uuid] Error 1
make[2]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:869: iperf3] Error 1
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_store_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_load_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_store_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_load_8'
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:885: t_timer] Error 1
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_store_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_fetch_add_8'
/usr/lib/gcc/i586-alpine-linux-musl/13.2.1/../../../../i586-alpine-linux-musl/bin/ld: ./.libs/libiperf.so: undefined reference to `__atomic_load_8'
make[2]: *** [Makefile:877: t_api] Error 1
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:889: t_units] Error 1
make[2]: Leaving directory '/tmp/iperf-3.16/src'
make[1]: Leaving directory '/tmp/iperf-3.16/src'
make[1]: *** [Makefile:720: all] Error 2
make: *** [Makefile:398: all-recursive] Error 1

Similarly with #1612 fix applied:

$ podman run --rm -i --arch i386 docker.io/alpine sh <<EOF
apk add gcc musl-dev make patch autoconf automake libtool
cd /tmp
wget -O - https://github.com/esnet/iperf/releases/download/3.16/iperf-3.16.tar.gz | tar zxf -
cd iperf-3.16
wget -O - https://github.com/esnet/iperf/pull/1612.patch | patch -p1
aclocal
autoconf
automake
./configure CFLAGS="-march=i386"
make -j$(nproc)
EOF

Builds fine.

swlars pushed a commit that referenced this issue May 10, 2024
---------------------

* Notable user-visible changes

  * BREAKING CHANGE: iperf3's authentication features, when used with
    OpenSSL prior to 3.2.0, contain a vulnerability to a side-channel
    timing attack. To address this flaw, a change has been made to the
    padding applied to encrypted strings. This change is not backwards
    compatible with older versions of iperf3 (before 3.17). To restore
    the older (vulnerable) behavior, and hence
    backwards-compatibility, use the --use-pkcs1-padding flag. The
    iperf3 team thanks Hubert Kario from RedHat for reporting this
    issue and providing feedback on the fix. (CVE-2024-26306)(PR#1695)

  * iperf3 no longer changes its current working directory in --daemon
    mode. This results in more predictable behavior with relative
    paths, in particular finding key and credential files for
    authentication. (PR#1672)

  * A new --json-stream option has been added to enable a streaming
    output format, consisting of a series of JSON objects (for the
    start of the test, each measurement interval, and the end of the
    test) separated by newlines (#444, #923, #1098).

  * UDP tests now work correctly between different endian hosts
    (#1415).

  * The --fq-rate parameter now works for --reverse tests (#1632, PR#1667).

  * The statistics reporting interval is now available in the --json
    start test object (#1663).

  * A negative time test duration is now properly flagged as an error
    (IS#1662 / PR#1666).

* Notable developer-visible changes

  * Fixes have been made to better (unofficially) support builds on
    Android (#1641 / #1651) and VxWorks (#1595).

  * iperf3 now builds correctly on architectures without native
    support for 64-bit atomic types, by linking with the libatomic
    library (#1611).
swlars pushed a commit that referenced this issue May 10, 2024
---------------------

* Notable user-visible changes

  * BREAKING CHANGE: iperf3's authentication features, when used with
    OpenSSL prior to 3.2.0, contain a vulnerability to a side-channel
    timing attack. To address this flaw, a change has been made to the
    padding applied to encrypted strings. This change is not backwards
    compatible with older versions of iperf3 (before 3.17). To restore
    the older (vulnerable) behavior, and hence
    backwards-compatibility, use the --use-pkcs1-padding flag. The
    iperf3 team thanks Hubert Kario from RedHat for reporting this
    issue and providing feedback on the fix. (CVE-2024-26306)(PR#1695)

  * iperf3 no longer changes its current working directory in --daemon
    mode. This results in more predictable behavior with relative
    paths, in particular finding key and credential files for
    authentication. (PR#1672)

  * A new --json-stream option has been added to enable a streaming
    output format, consisting of a series of JSON objects (for the
    start of the test, each measurement interval, and the end of the
    test) separated by newlines (#444, #923, #1098).

  * UDP tests now work correctly between different endian hosts
    (#1415).

  * The --fq-rate parameter now works for --reverse tests (#1632, PR#1667).

  * The statistics reporting interval is now available in the --json
    start test object (#1663).

  * A negative time test duration is now properly flagged as an error
    (IS#1662 / PR#1666).

* Notable developer-visible changes

  * Fixes have been made to better (unofficially) support builds on
    Android (#1641 / #1651) and VxWorks (#1595).

  * iperf3 now builds correctly on architectures without native
    support for 64-bit atomic types, by linking with the libatomic
    library (#1611).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants