Skip to content

Conversation

@LocutusOfBorg
Copy link
Contributor

With Ubuntu, the wl,asneeded flags i injected automatically.
This causes the link fail, because of LDFLAGS being put before common.c when autoconf runs.
$CC $CPPFLAGS $CFLAGS $LDFLAGS sourcefile.c $LIBS
^^ gcc strips the library because it is put before the file being compiled and then fails.

failure:
configure:26271: $? = 1
configure:26590: checking for LUAJIT
configure:26597: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26600: $? = 0
configure:26614: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26617: $? = 0
configure:27005: result: yes
configure:27061: checking jansson.h usability
configure:27061: cc -c -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c >&5
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking jansson.h presence
configure:27061: cc -E -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking for jansson.h
configure:27061: result: yes
configure:27067: checking whether jansson is dynamic
configure:27082: cc -o conftest -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC -ljansson conftest.c -lbrotlienc -lpthread -ldl >&5
/usr/bin/ld: /tmp/cc2Ctsj4.o: in function main': ./conftest.c:96: undefined reference to json_object'
collect2: error: ld returned 1 exit status
configure:27082: $? = 1

with this patch:
configure:26271: $? = 1
configure:26590: checking for LUAJIT
configure:26597: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26600: $? = 0
configure:26614: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26617: $? = 0
configure:27005: result: yes
configure:27061: checking jansson.h usability
configure:27061: cc -c -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c >&5
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking jansson.h presence
configure:27061: cc -E -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking for jansson.h
configure:27061: result: yes
configure:27067: checking whether jansson is dynamic
configure:27082: cc -o conftest -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now conftest.c -lbrotlienc -lpthread -ldl -fPIC -ljansson >&5
configure:27082: $? = 0
configure:27083: result: yes

With Ubuntu, the wl,asneeded flags i injected automatically.
This causes the link fail, because of LDFLAGS being put before common.c when autoconf runs.
$CC $CPPFLAGS $CFLAGS $LDFLAGS sourcefile.c $LIBS
^^ gcc strips the library because it is put before the file being compiled and then fails.

failure:
configure:26271: $? = 1
configure:26590: checking for LUAJIT
configure:26597: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26600: $? = 0
configure:26614: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26617: $? = 0
configure:27005: result: yes
configure:27061: checking jansson.h usability
configure:27061: cc -c -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c >&5
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking jansson.h presence
configure:27061: cc -E -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking for jansson.h
configure:27061: result: yes
configure:27067: checking whether jansson is dynamic
configure:27082: cc -o conftest -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC -ljansson conftest.c -lbrotlienc -lpthread -ldl  >&5
/usr/bin/ld: /tmp/cc2Ctsj4.o: in function `main':
./conftest.c:96: undefined reference to `json_object'
collect2: error: ld returned 1 exit status
configure:27082: $? = 1

with this patch:
configure:26271: $? = 1
configure:26590: checking for LUAJIT
configure:26597: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26600: $? = 0
configure:26614: $PKG_CONFIG --exists --print-errors "luajit >= 2.0.4"
configure:26617: $? = 0
configure:27005: result: yes
configure:27061: checking jansson.h usability
configure:27061: cc -c -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c >&5
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking jansson.h presence
configure:27061: cc -E -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN conftest.c
configure:27061: $? = 0
configure:27061: result: yes
configure:27061: checking for jansson.h
configure:27061: result: yes
configure:27067: checking whether jansson is dynamic
configure:27082: cc -o conftest -g -O2 -fdebug-prefix-map=/trafficserver-8.0.1=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -DOPENSSL_NO_SSL_INTERN -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now conftest.c -lbrotlienc -lpthread -ldl  -fPIC -ljansson >&5
configure:27082: $? = 0
configure:27083: result: yes
@randall randall added the Build work related to build configuration or environment label Jan 13, 2019
@randall randall added this to the 9.0.0 milestone Jan 13, 2019
@randall
Copy link
Contributor

randall commented Jan 13, 2019

[approve ci]

@bryancall bryancall merged commit 8434893 into apache:master Jan 16, 2019
@LocutusOfBorg LocutusOfBorg deleted the patch-2 branch January 31, 2019 17:31
@bryancall bryancall modified the milestones: 9.0.0, 8.1.0 Mar 27, 2019
@bryancall
Copy link
Contributor

Cherry picked to 8.1.0

raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Jul 9, 2019
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Jul 11, 2019
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Aug 5, 2019
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Aug 17, 2019
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Aug 27, 2019
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Oct 31, 2019
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Feb 18, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Mar 8, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
@zwoop zwoop modified the milestones: 8.1.0, 8.1.0-nogo Mar 18, 2020
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Apr 24, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Jul 2, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Aug 12, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Oct 17, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Nov 30, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Dec 12, 2020
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Aug 20, 2021
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
raspbian-autopush pushed a commit to raspbian-packages/trafficserver that referenced this pull request Jun 9, 2022
Forwarded: apache/trafficserver#4793
Last-Update: 2019-01-12


Gbp-Pq: Name 0015-as-needed-fix.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants