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

Fix stripping binaries from debugging symbols #87

Merged
merged 1 commit into from
May 6, 2020

Conversation

seiko2plus
Copy link
Contributor

No description provided.

@mattip
Copy link
Contributor

mattip commented May 6, 2020

I am convinced that export LDFLAGS="$LDFLAGS" does something since now clang is complaining ld: unknown option: --strip-debug`.

@mattip
Copy link
Contributor

mattip commented May 6, 2020

According to this stack overflow, clang accepts -Wl,-s. Does that work with gcc as well? But then I think that does too much: you wanted --strip-debug not --strip-all.

@seiko2plus
Copy link
Contributor Author

seiko2plus commented May 6, 2020

@mattip, when I mentioned the use LDFLAGS instead of CFLAGS that because of clang usually produce warning message like this clang: warning: -Wl,-strip-debug: 'linker' input unused when '-S' is present if there are no objects represented to be linked, so I thought that was the reason of build failure. but I was wrong since the issue in macOS's linker, it simply doesn't support stripping symbols.

@mattip
Copy link
Contributor

mattip commented May 6, 2020

I think you can add a conditional if [ -z "$IS_OSX" ]; then CFLAGS=...; else CFLAGS=...; fi

@seiko2plus
Copy link
Contributor Author

seiko2plus commented May 6, 2020

@mattip, better to avoid manybuild vars, in case if they change it or it may exposed in different domain. I fixed the bash path, and I think it works fine now. however, now we have an issue with macOS and I guess numpy/numpy#16110 became necessary.

EDIT: macOS doesn't require any stripping since DSYM files aren't combined with the wheel package.

@charris charris merged commit 11d6d89 into MacPython:master May 6, 2020
@charris
Copy link
Contributor

charris commented May 6, 2020

Thanks @seiko2plus, let's see if it makes a difference.

@charris
Copy link
Contributor

charris commented May 6, 2020

The _multiarray_umath binary is about 1/10 the size and the manylinux1 files contain OpenBLAS. So good progress here. If we could shrink OpenBLAS...

@charris
Copy link
Contributor

charris commented May 6, 2020

@mattip @tylerjereddy Looks like I don't have permissions to remove files in the nightly build directory.

@tylerjereddy
Copy link
Contributor

@charris You should now--I think added you to the staging site last time instead maybe? Anyway, you probably want access to both and hopefully have it now.

@seiko2plus
Copy link
Contributor Author

seiko2plus commented May 7, 2020

@charris, OpenBLAS's shared object doesn't contain any debugging symbols, ususaly all c/c++ projects that use CMake or gnu autobuild tools don't provide debug info flag -g for release stages.

 bloaty libopenblasp-r0-edd6b1a3.3.9.dev.so
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  88.0%  24.8Mi  90.5%  24.8Mi    .text
   3.1%   884Ki   3.2%   884Ki    .eh_frame
   2.0%   573Ki   0.0%       0    .symtab
   1.0%   289Ki   1.0%   289Ki    [LOAD #0 [RX]]
   1.0%   279Ki   0.0%       0    .strtab
   1.0%   276Ki   1.0%   276Ki    .dynsym
   0.7%   198Ki   0.7%   198Ki    .dynstr
   0.7%   198Ki   0.7%   198Ki    [LOAD #7 [RW]]
   0.7%   188Ki   0.7%   188Ki    .rela.dyn
   0.4%   121Ki   0.4%   121Ki    .rodata
   0.3%  94.6Ki   0.3%  94.6Ki    .eh_frame_hdr
   0.3%  90.6Ki   0.3%  90.5Ki    .rela.plt
   0.3%  85.9Ki   0.3%  85.8Ki    .gnu.hash
   0.2%  60.4Ki   0.2%  60.3Ki    .plt
   0.0%       0   0.2%  60.0Ki    .tbss
   0.2%  47.7Ki   0.1%  40.1Ki    .data
   0.0%       0   0.2%  47.0Ki    .bss
   0.1%  30.2Ki   0.0%       0    .got.plt
   0.1%  23.1Ki   0.1%  23.0Ki    .gnu.version
   0.1%  20.9Ki   0.0%       0    .data.rel.ro
   0.0%  8.78Ki   0.0%     349    [15 Others]
 100.0%  28.2Mi 100.0%  27.4Mi    TOTAL

@rgommers
Copy link
Contributor

I thought there was a SciPy issue or PR for this as well, but I can't find it anymore. Is my memory tricking me, or am I just bad at searching?

@mattip
Copy link
Contributor

mattip commented May 17, 2020

Maybe matthew-brett/multibuild#162 which is still open

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.

5 participants