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

foundationdb: fix build for current glibc version #100264

Merged
merged 3 commits into from Oct 12, 2020

Conversation

das-g
Copy link
Member

@das-g das-g commented Oct 11, 2020

Adapt one of the patches so that foundationdb can be built on current glibc versions.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

by applying it to apple/foundationdb@5.1.7 and running

    git diff > ${path_to_nixpkgs}/pkgs/servers/foundationdb/patches/gcc-fixes.patch

again.
Since glibc 2.28, `<sys/types.h>` no longer includes
`<sys/sysmacros.h>`, which provides these macros,
so we have to explicitly import the latter, too, to fix the following
build problems:

    flow/Platform.cpp: In function 'void getDiskStatistics(const string&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint64_t&)':
    flow/Platform.cpp:626:56: error: 'gnu_dev_major' was not declared in this scope
       if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) {
                                                            ^
    flow/Platform.cpp:626:111: error: 'gnu_dev_minor' was not declared in this scope
       if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) {
                                                                                                                   ^
to avoid build error due to conflicting declaration:

    flow/Profiler.actor.cpp: In function 'uint64_t gettid()':
    flow/Profiler.actor.cpp:56:17: error: ambiguating new declaration of 'uint64_t gettid()'
      FILE* f;
                     ^
    In file included from /nix/store/4wy9j24psf9ny4di3anjs7yk2fvfb0gq-glibc-2.31-dev/include/unistd.h:1170:0,
                     from ./flow/Platform.h:49,
                     from ./flow/flow.h:40,
                     from flow/Profiler.actor.cpp:39:
    /nix/store/4wy9j24psf9ny4di3anjs7yk2fvfb0gq-glibc-2.31-dev/include/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
     extern __pid_t gettid (void) __THROW;
                    ^~~~~~
@doronbehar doronbehar merged commit f9176c0 into NixOS:master Oct 12, 2020
@das-g das-g deleted the foundationdb branch October 12, 2020 20:50
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.

None yet

2 participants