Skip to content

Fixed warnings of duplicate libs#4177

Merged
sauwming merged 1 commit intomasterfrom
dup-lib-warning
Dec 4, 2024
Merged

Fixed warnings of duplicate libs#4177
sauwming merged 1 commit intomasterfrom
dup-lib-warning

Conversation

@sauwming
Copy link
Copy Markdown
Member

@sauwming sauwming commented Nov 25, 2024

Fixed the following warnings:
ld: warning: ignoring duplicate libraries: '-lSDL2', '-lc++, '-lixml', '-lupnp', '-lvpx'

@sauwming sauwming added this to the release-2.15 milestone Nov 25, 2024
@sauwming sauwming self-assigned this Nov 25, 2024
$(PJLIB_LDLIB) \
@LIBS@
export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \
-lstdc++ \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC there was an issue related to missing libstdc++ but can't remember the details (which platform, SDK version, etc).
The point is better duplicated than missed? So please make sure this is always duplicated before removing it :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, I wasn't 100% certain about this as well, but since the linker warning pops quite a lot and it can't be suppressed (Apple clang doesn't seem to support -Wl,--allow-multiple-definition nor -Wl,-z,muldefs) and I have tested the patch on Mac, iOS, and Android, I thought it should be okay.

But yes, it's probably safer to wait until the release, since the risk is a broken build.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reopening this. Passed the CI tests, so the patch seems okay.

As for libstdc++, it's duplicated here in PJSUA2_LIB_LDFLAGS:
https://github.com/pjsip/pjproject/blob/master/pjsip/build/Makefile#L156
which should be more appropriate since it belongs to the pjsua2 C++ library, rather than put it in build.mak.in, which applies to the entire library.

@sauwming sauwming removed this from the release-2.15 milestone Nov 25, 2024
@sauwming sauwming closed this Nov 25, 2024
@sauwming sauwming reopened this Dec 4, 2024
@sauwming sauwming added this to the release-2.16 milestone Dec 4, 2024
@sauwming sauwming requested a review from nanangizz December 4, 2024 01:57
@sauwming sauwming merged commit 8117bc5 into master Dec 4, 2024
@sauwming sauwming deleted the dup-lib-warning branch December 4, 2024 04:16
sauwming added a commit that referenced this pull request Dec 17, 2024
sauwming added a commit that referenced this pull request Dec 18, 2024
BarryYin pushed a commit to BarryYin/pjproject that referenced this pull request Feb 3, 2026
BarryYin pushed a commit to BarryYin/pjproject that referenced this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants