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

static builds link against musl #3343

Merged
merged 3 commits into from
Dec 10, 2015
Merged

static builds link against musl #3343

merged 3 commits into from
Dec 10, 2015

Commits on Dec 9, 2015

  1. Configuration menu
    Copy the full SHA
    2d4e758 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d05e064 View commit details
    Browse the repository at this point in the history
  3. Makefile: link against musl instead of glibc on static builds

    This works around golang/go#13470 with the
    biggest hammer I could find.
    
    Another option is to go the route of dynamic linking, but this has
    unfortunate implications for our `c-*` dependencies' builds; for
    instance, in a dynamic build, c-rocksdb ends up linking against more
    than just glibc, greatly increasing the surface of libraries required
    to run cockroach. Having run such a build, the list of dependencies
    ends up being quite large:
    
    ```
    $ ldd ./cockroach
    	linux-vdso.so.1 (0x00007fff60bcc000)
    	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f60d0fc9000)
    	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f60d0dac000)
    	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f60d0aa0000)
    	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f60d079f000)
    	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f60d0589000)
    	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f60d01df000)
    	/lib64/ld-linux-x86-64.so.2 (0x00005620684d4000)
    ```
    
    We could vigilantly produce static binaries upstream and lint agianst
    excessive dynamic dependencies, but the musl route is a shorter path
    to correctness.
    tamird committed Dec 9, 2015
    Configuration menu
    Copy the full SHA
    5585382 View commit details
    Browse the repository at this point in the history