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

atomicparsley: fix cross #60678

Merged
merged 1 commit into from May 7, 2019
Merged

Conversation

globin
Copy link
Member

@globin globin commented May 1, 2019

Motivation for this change

https://nerdland.net/unstumping-the-internet/malloc-has-not-been-declared/

fixes:

aarch64-unknown-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I./src  -DHAVE_CONFIG_H    -D_FILE_OFFSET_BITS=64 -g -O2 -Wall -c -o src/util.o src/util.cpp
In file included from /nix/store/b9iyqcsd1gmlfagpi4xqqlswcpx079r1-aarch64-unknown-linux-gnu-stage-final-gcc-debug-7.4.0/aarch64-unknown-linux-gnu/include/c++/7.4.0/stdlib.h:36:0,
                 from src/AtomicParsley.h:54,
                 from src/util.cpp:29:
/nix/store/b9iyqcsd1gmlfagpi4xqqlswcpx079r1-aarch64-unknown-linux-gnu-stage-final-gcc-debug-7.4.0/aarch64-unknown-linux-gnu/include/c++/7.4.0/cstdlib:151:11: error: '::malloc' has not been declared
   using ::malloc;
           ^~~~~~
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • N/A 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

  • This should just be done on cross building
  • Setting ac_cv_func_malloc_0_nonnull and ac_cv_func_realloc_0_nonnull like here is more obvious:
    ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
    # AC_FUNC_MALLOC is broken on cross builds.
    "ac_cv_func_malloc_0_nonnull=yes"
    "ac_cv_func_realloc_0_nonnull=yes"

@globin globin requested a review from matthewbauer May 1, 2019 22:15
@globin globin merged commit 9745071 into NixOS:master May 7, 2019
@globin globin deleted the atomicparsley-cross branch May 7, 2019 09: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