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

Fix a build issue from iocore cleanup #12000

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

moonchen
Copy link
Contributor

The build of test_net was broken on Mac when the build mode is set to release.

Root cause:

We support two kinds of linkers. One kind will only search for symbols that are to the left of the object being linked. Another kind will search the list of libraries repeatedly until the no new undefined references are created. Both are sensitive to the order of libraries on the command line.

In order to work with both, we have to carefully order our dependencies in cmake. See the build rule for traffic_server for a working list of dependencies.

In this case, libinknet_stub.cc provides some symbols that are also provided by ts::proxy, in order to fix an issue of cyclic dependency between ts::inknet and ts::proxy. However, this causes the link to have duplicate symbols when libraries are not ordered correctly, on linkers that repeat through the list.

References:

https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc

The build of test_net was broken on Mac when the build mode is set to
release.

Root cause:

We support two kinds of linkers.  One kind will only search for
symbols that are to the left of the object being linked.  Another kind
will search the list of libraries repeatedly until the no new undefined
references are created.  Both are sensitive to the order of libraries
on the command line.

In order to work with both, we have to carefully order our dependencies
in cmake.  See the build rule for traffic_server for a working list of
dependencies.

In this case, libinknet_stub.cc provides some symbols that are also
provided by ts::proxy, in order to fix an issue of cyclic dependency
between ts::inknet and ts::proxy.  However, this causes the link to
have duplicate symbols when libraries are not ordered correctly, on
linkers that repeat through the list.

References:

https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc
@moonchen moonchen added this to the 10.1.0 milestone Jan 29, 2025
@moonchen moonchen added Build work related to build configuration or environment Must-Fix labels Jan 29, 2025
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 Must-Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant