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

xz: Compile with PIC to fix linking errors #8159

Merged
merged 1 commit into from
Feb 12, 2019
Merged

xz: Compile with PIC to fix linking errors #8159

merged 1 commit into from
Feb 12, 2019

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Feb 9, 2019

While researching CircleCI build failures, I came across a linking error
relating to liblzma, where ld instructs to recompile with fPIC.

Unfortunately, this increases filesize. Added some configure flags to try
to mitigate is somewhat.

Signed-off-by: Rosen Penev rosenp@gmail.com

Maintainer: nobody
Compile tested: ramips

Error: https://gist.github.com/neheb/9d3d0a2583e6e190e7254db078128640

@diizzyy
Copy link
Contributor

diizzyy commented Feb 9, 2019

We can't use $(FPIC) instead?

@neheb
Copy link
Contributor Author

neheb commented Feb 9, 2019

This is simpler. The configure script has native support for it.

@diizzyy
Copy link
Contributor

diizzyy commented Feb 9, 2019

We should probably drop assume ram as it breaks functionality over the board and dropping --enable-small wouldn't hurt anyone.
https://chromium.googlesource.com/chromium/deps/xz/+/77022065014d48cf51d83322264ab4836fd175ec/configure.ac#347
Perhaps -flto can help keeping the size down?

@neheb
Copy link
Contributor Author

neheb commented Feb 9, 2019

Unfortunately, I can't see any history into why assume-ram=4 was added. Maybe use on a 16MB device? Could increase to 64MB as that seems to be the new minimum. That's concerning that it breaks decompressing xz -9 archives though...

While researching CircleCI build failures, I came across a linking error
relating to liblzma, where ld instructs to recompile with fPIC.

Unfortunately, this increases filesize. Added some configure flags to try
to mitigate is somewhat.

Removed maintainer as he is no longer active.

Added PKG_CPE_ID for proper CVE tracking.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@neheb
Copy link
Contributor Author

neheb commented Feb 9, 2019

Added LTO. Funny enough, adding

TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto

increases ipk size from 50491 to 50516. No idea why.

@diizzyy
Copy link
Contributor

diizzyy commented Feb 9, 2019

¯\_(ツ)_/¯

@thess thess merged commit 96921a2 into openwrt:master Feb 12, 2019
@neheb neheb deleted the xz branch February 12, 2019 16:15
@neheb neheb mentioned this pull request Feb 14, 2019
jow- pushed a commit to lede-project/source that referenced this pull request Apr 6, 2019
I made a similar change to this here:
openwrt/packages#8159

However, it turns out this did not fix the problem as the problem has to
do with tools/xz and not the xz package. The error is the same and causes
linking errors as can be seen above.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
jollaman999 pushed a commit to jollaman999/openwrt that referenced this pull request Apr 9, 2019
I made a similar change to this here:
openwrt/packages#8159

However, it turns out this did not fix the problem as the problem has to
do with tools/xz and not the xz package. The error is the same and causes
linking errors as can be seen above.

Signed-off-by: Rosen Penev <rosenp@gmail.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 this pull request may close these issues.

3 participants