Skip to content

Linking fails with undefined nghttp2 references when pkg-config is not installed #11186

Closed

Description

@correctmost

I did this

I tried to compile curl on Manjaro Linux and encountered linking failures because I didn't have pkg-config installed.

Steps to reproduce

  • Save the following Dockerfile
FROM archlinux:base-20230521.0.152478
USER root

# Note: pkg-config is *not* included
RUN pacman -Sy --noconfirm autoconf automake binutils gcc git libtool make

WORKDIR /root/
RUN git clone --depth 1 https://github.com/curl/curl.git

WORKDIR /root/curl
RUN autoreconf -fi && \
  ./configure --with-openssl && \
  make -j3
  • Run docker image build . -f Dockerfile -t curl:nghttp2-config-repro

Docker build results

#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_consume'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_pack_settings_payload'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_http2_strerror'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_submit_request'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_submit_rst_stream'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_priority_spec_init'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_get_stream_user_data'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_strerror'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_client_new2'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_on_data_chunk_recv_callback'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_get_stream_remote_window_size'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_set_stream_user_data'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_send'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_del'
#0 81.52 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_submit_ping'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_send_callback'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_option_set_no_auto_window_update'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_on_frame_recv_callback'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_option_new'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_get_remote_window_size'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_new'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_want_read'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_check_request_allowed'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_is_fatal'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_mem_recv'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_submit_priority'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_want_write'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_upgrade2'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_option_del'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_submit_settings'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_on_begin_headers_callback'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_error_callback'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_on_stream_close_callback'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_callbacks_set_on_header_callback'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_resume_data'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_set_local_window_size'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_get_remote_settings'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_version'
#0 81.53 /usr/sbin/ld: ../lib/.libs/libcurl.so: undefined reference to `nghttp2_session_del'
#0 81.53 collect2: error: ld returned 1 exit status
#0 81.54 make[2]: *** [Makefile:1018: curl] Error 1
#0 81.54 make[2]: Leaving directory '/root/curl/src'
#0 81.54 make[1]: *** [Makefile:1496: all-recursive] Error 1
#0 81.54 make[1]: Leaving directory '/root/curl/src'
#0 81.54 make: *** [Makefile:1267: all-recursive] Error 1

I expected the following

I would expect the configure script to fail if all dependencies are not met.

curl/libcurl version

2706bc0

Operating System

Linux [hostname] 6.1.29-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed May 17 14:00:55 UTC 2023 x86_64 GNU/Linux

Related changes:

Activity

  1. self-assigned this
    on May 26, 2023
  2. added a commit that references this issue on May 26, 2023
    7041fe1
  3. added a commit that references this issue on Jul 19, 2023
    bf9a877
  4. added a commit that references this issue on Mar 27, 2024
    814d3ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions