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

Unable to compile on Fedora 32 #42

Open
huaracheguarache opened this issue May 4, 2020 · 6 comments
Open

Unable to compile on Fedora 32 #42

huaracheguarache opened this issue May 4, 2020 · 6 comments

Comments

@huaracheguarache
Copy link

As the title states, I'm unable to compile netperf on Fedora 32. What I've done so far is run (without any apparent issues):

./autogen.sh
./configure --enable-demo

When I run make I get the following error:

[michael@localhost netperf]$ make
(CDPATH="${ZSH_VERSION+.}:" && cd . && autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: Entering directory '/home/michael/src/router_stuff/netperf'
Making all in src
make[2]: Entering directory '/home/michael/src/router_stuff/netperf/src'
Making all in missing
make[3]: Entering directory '/home/michael/src/router_stuff/netperf/src/missing'
Making all in m4
make[4]: Entering directory '/home/michael/src/router_stuff/netperf/src/missing/m4'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/michael/src/router_stuff/netperf/src/missing/m4'
make[4]: Entering directory '/home/michael/src/router_stuff/netperf/src/missing'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/michael/src/router_stuff/netperf/src/missing'
make[3]: Leaving directory '/home/michael/src/router_stuff/netperf/src/missing'
make[3]: Entering directory '/home/michael/src/router_stuff/netperf/src'
gcc -DHAVE_CONFIG_H -I. -I..      -MT netperf.o -MD -MP -MF .deps/netperf.Tpo -c -o netperf.o netperf.c
mv -f .deps/netperf.Tpo .deps/netperf.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netlib.o -MD -MP -MF .deps/netlib.Tpo -c -o netlib.o netlib.c
netlib.c: In function ‘bind_to_specific_processor’:
netlib.c:2343:9: warning: implicit declaration of function ‘sched_setaffinity’; did you mean ‘SYS_sched_setaffinity’? [-Wimplicit-function-declaration]
 2343 |     if (sched_setaffinity(getpid(), len, &netperf_cpu_set)) {
      |         ^~~~~~~~~~~~~~~~~
      |         SYS_sched_setaffinity
mv -f .deps/netlib.Tpo .deps/netlib.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netsh.o -MD -MP -MF .deps/netsh.Tpo -c -o netsh.o netsh.c
mv -f .deps/netsh.Tpo .deps/netsh.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_bsd.o -MD -MP -MF .deps/nettest_bsd.Tpo -c -o nettest_bsd.o nettest_bsd.c
mv -f .deps/nettest_bsd.Tpo .deps/nettest_bsd.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_dlpi.o -MD -MP -MF .deps/nettest_dlpi.Tpo -c -o nettest_dlpi.o nettest_dlpi.c
mv -f .deps/nettest_dlpi.Tpo .deps/nettest_dlpi.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_unix.o -MD -MP -MF .deps/nettest_unix.Tpo -c -o nettest_unix.o nettest_unix.c
mv -f .deps/nettest_unix.Tpo .deps/nettest_unix.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_xti.o -MD -MP -MF .deps/nettest_xti.Tpo -c -o nettest_xti.o nettest_xti.c
mv -f .deps/nettest_xti.Tpo .deps/nettest_xti.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_sctp.o -MD -MP -MF .deps/nettest_sctp.Tpo -c -o nettest_sctp.o nettest_sctp.c
mv -f .deps/nettest_sctp.Tpo .deps/nettest_sctp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_sdp.o -MD -MP -MF .deps/nettest_sdp.Tpo -c -o nettest_sdp.o nettest_sdp.c
mv -f .deps/nettest_sdp.Tpo .deps/nettest_sdp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT nettest_omni.o -MD -MP -MF .deps/nettest_omni.Tpo -c -o nettest_omni.o nettest_omni.c
nettest_omni.c: In function ‘recv_data_no_copy’:
nettest_omni.c:3140:19: warning: implicit declaration of function ‘splice’ [-Wimplicit-function-declaration]
 3140 |     bytes_recvd = splice(data_socket,
      |                   ^~~~~~
mv -f .deps/nettest_omni.Tpo .deps/nettest_omni.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT net_uuid.o -MD -MP -MF .deps/net_uuid.Tpo -c -o net_uuid.o net_uuid.c
mv -f .deps/net_uuid.Tpo .deps/net_uuid.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT dscp.o -MD -MP -MF .deps/dscp.Tpo -c -o dscp.o dscp.c
mv -f .deps/dscp.Tpo .deps/dscp.Po
gcc -DHAVE_CONFIG_H -I. -I..      -MT netcpu_procstat.o -MD -MP -MF .deps/netcpu_procstat.Tpo -c -o netcpu_procstat.o netcpu_procstat.c
mv -f .deps/netcpu_procstat.Tpo .deps/netcpu_procstat.Po
gcc     -o netperf netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o nettest_omni.o net_uuid.o dscp.o netcpu_procstat.o  -lrt -lm 
/usr/bin/ld: nettest_omni.o:(.bss+0x208): multiple definition of `loc_nodelay'; nettest_bsd.o:(.bss+0x20): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x20c): multiple definition of `rem_nodelay'; nettest_bsd.o:(.bss+0x24): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x210): multiple definition of `loc_sndavoid'; nettest_bsd.o:(.bss+0x40): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x214): multiple definition of `loc_rcvavoid'; nettest_bsd.o:(.bss+0x44): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x218): multiple definition of `rem_sndavoid'; nettest_bsd.o:(.bss+0x48): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x21c): multiple definition of `rem_rcvavoid'; nettest_bsd.o:(.bss+0x4c): first defined here
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:419: netperf] Error 1
make[3]: Leaving directory '/home/michael/src/router_stuff/netperf/src'
make[2]: *** [Makefile:473: all-recursive] Error 1
make[2]: Leaving directory '/home/michael/src/router_stuff/netperf/src'
make[1]: *** [Makefile:374: all-recursive] Error 1
make[1]: Leaving directory '/home/michael/src/router_stuff/netperf'
make: *** [Makefile:313: all] Error 2
@huaracheguarache
Copy link
Author

Ok, I got it to work. Fedora 32 uses GCC 10 which by default compiles with -fno-common. As a workaround you can pass -fcommon to GCC via make:

make CFLAGS="-fcommon"

I found this workaround here: https://gcc.gnu.org/gcc-10/porting_to.html

@itayave
Copy link

itayave commented Jun 18, 2020

Thanks,
Are you planning to provide a fix? if so, when?

@huaracheguarache
Copy link
Author

@itayave Fixing the source code? I don't plan on doing that since I have no experience with C.

@guidosarducci
Copy link

Regarding a code fix, see openwrt/packages#13058 as an example.

@westurner
Copy link

Would #46 "nettest_omni: Remove duplicate variable definitions" fix this issue as well?

@westurner
Copy link

westurner commented May 31, 2021

Note that I'm still unable to compile now able to compile on FC34 with ~this Dockerfile:

# RUN dnf install -y [...]

## Install dotfiles
ARG uid=1000
ARG user="appuser"
ARG home="/home/${user}"
ARG __wrk="${home}/-wrk"
ARG workon_home="${__wrk}/-ve39"
ARG venvname="turnernet"
ARG project="${__wrk}/${venvname}"
ARG virtual_env="${workon_home}/${venvname}"


# Install flent (requires netperf)
RUN HOME="${home}" \
    PATH="${home}/.local/bin:${PATH}" \
    python -m pip install --user flent && \
    cd "${__wrk}" && \
    (test -d netperf \
      || git clone https://github.com/HewlettPackard/netperf) && \
    cd netperf && \
    ./autogen.sh && \
    ./configure --enable-demo --prefix=/usr/local
USER root
RUN make -C "${__wrk}/netperf" CFLAGS="-fcommon" && make -C "${__wrk}/netperf" install

USER 1000
# COPY --chown=${user} \
COPY --chown=1000:1000 \
     requirements.txt requirements_dev.txt "${__wrk}/"
RUN python3 -m venv "${virtual_env}" \
    && "${virtual_env}/bin/python" -m pip install \
    -r "${__wrk}/requirements_dev.txt" \
    -r "${__wrk}/requirements.txt" \
    notebook jupyterlab jupyter_contrib_nbextensions \
    flent matplotlib \
    pandas
EXPOSE 18888/tcp

rli9 pushed a commit to intel/lkp-tests that referenced this issue Jun 2, 2022
Fix following issue:

```
/usr/bin/ld: nettest_omni.o:(.bss+0x208): multiple definition of `loc_nodelay'; nettest_bsd.o:(.bss+0x20): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x20c): multiple definition of `rem_nodelay'; nettest_bsd.o:(.bss+0x24): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x210): multiple definition of `loc_sndavoid'; nettest_bsd.o:(.bss+0x30): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x214): multiple definition of `loc_rcvavoid'; nettest_bsd.o:(.bss+0x34): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x218): multiple definition of `rem_sndavoid'; nettest_bsd.o:(.bss+0x38): first defined here
/usr/bin/ld: nettest_omni.o:(.bss+0x21c): multiple definition of `rem_rcvavoid'; nettest_bsd.o:(.bss+0x3c): first defined here
/usr/bin/ld: nettest_unix.o: in function `recv_stream_stream':
nettest_unix.c:(.text+0xd7e): warning: the use of `tempnam' is dangerous, better use `mkstemp'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:305: netperf] Error 1
```

makepkg RT:

```
{
  "makepkg.pass": [
    1
  ]
}
```

Link: HewlettPackard/netperf#42
Signed-off-by: Zou Yu <yux.zou@intel.com>
Signed-off-by: Philip Li <philip.li@intel.com>
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 a pull request may close this issue.

4 participants