Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

strip when linking #82

Closed
wants to merge 2 commits into from
Closed

strip when linking #82

wants to merge 2 commits into from

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Apr 30, 2020

we should strip the linux binaries before shipping. Issue gh-19 assumed that we do not override CFLAGS, but we do.

@mattip
Copy link
Contributor Author

mattip commented Apr 30, 2020

It seems to work, the size in MB of the manylinux builds decreased:

wheel before after
cp36-cp36m-manylinux1_x86_64 19.2 12.5
cp38-cp38-manylinux1_i686 17.0 10.6

Edit: this was wrong, the commit changed nothing.

@seiko2plus
Copy link
Contributor

@mattip, using -strip-all will not only remove the debugging symbol table but also remove other important tables such as symtab, I suggest replacing it with -strip-debug instead. try to use nm command to verify it.

@mattip
Copy link
Contributor Author

mattip commented May 1, 2020

@seiko2plus Who would use the symtab table?

@seiko2plus
Copy link
Contributor

@mattip, It will not harm if we left the default generated elf sections untouched. symtab doesn't take that much space, the issue in debug_* sections. symtab is useful with Valgrind and simple backtraces. also, it could be helpful to trace the inner loops of ufunc, for example checking the binary support of SIMD optimizations through nm command.

@mattip
Copy link
Contributor Author

mattip commented May 2, 2020

My check was wrong, the file sizes did not change. I must have looked while upload was still in progress. The CFLAGS set in env_vars.sh overrides any subsequent changes in the multibuild system, so these CFLAGS are the ones that are appended to the gcc command line in numpy/distutils. In dcceacd I added --strip-debug

@@ -1,4 +1,4 @@
# Environment variables for build
OPENBLAS_VERSION="v0.3.7"
MACOSX_DEPLOYMENT_TARGET=10.9
CFLAGS="-std=c99 -fno-strict-aliasing"
CFLAGS="-std=c99 -fno-strict-aliasing -Wl,--strip-debug"
Copy link
Contributor

@seiko2plus seiko2plus May 3, 2020

Choose a reason for hiding this comment

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

pass it to the linker flags only to not break clang build, LDFLAGS="-Wl,--strip-debug"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in gh-85

@mattip mattip mentioned this pull request May 6, 2020
@mattip
Copy link
Contributor Author

mattip commented May 6, 2020

Closing in favor of gh-86

@mattip mattip closed this May 6, 2020
@mattip mattip mentioned this pull request May 6, 2020
@charris charris deleted the append-flags branch May 6, 2020 12:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants