This is an archive of the discontinued LLVM Phabricator instance.

[gn build] Set llvm_have_mallinfo2 to true by default
ClosedPublic

Authored by aeubanks on May 25 2022, 1:34 PM.

Details

Summary

If you are using an old enough glibc which doesn't have mallinfo2, set
llvm_have_mallinfo2 = false.

At this point it's likely that most people using the gn build are
compiling against a recent enough glibc (glibc 2.33 which was released
in Feb 2021).

Diff Detail

Event Timeline

aeubanks created this revision.May 25 2022, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 1:34 PM
aeubanks requested review of this revision.May 25 2022, 1:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 1:34 PM
peterwaller-arm accepted this revision.May 25 2022, 1:50 PM

Thanks for the note, I appreciate it.

This revision is now accepted and ready to land.May 25 2022, 1:50 PM
peterwaller-arm added a comment.EditedMay 25 2022, 1:52 PM

For anyone wandering the internet in search of an answer to all their woes (probably future me, Hi future me!), this is the relevant error.

FAILED: obj/llvm/lib/Support/Support.Process.o
clang++ -MMD -MF obj/llvm/lib/Support/Support.Process.o.d -o obj/llvm/lib/Support/Support.Process.o -c ../../llvm/lib/Support/Process.cpp  -I../../llvm/lib/Support/Unix -I../../llvm/lib/Support/Windows -I../../llvm/include -Igen/llvm/include -O3 -fdiagnostics-color -Wall -Wextra -Wno-unused-parameter -Wdelete-non-virtual-dtor -Wstring-conversion -no-canonical-prefixes -Werror=date-time -fPIC -Wcovered-switch-default -std=c++14 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti
In file included from ../../llvm/lib/Support/Process.cpp:107:
../../llvm/lib/Support/Unix/Process.inc:93:20: error: variable has incomplete type 'struct mallinfo2'
  struct mallinfo2 mi;
                   ^
../../llvm/lib/Support/Unix/Process.inc:93:10: note: forward declaration of 'mallinfo2'
  struct mallinfo2 mi;
         ^
../../llvm/lib/Support/Unix/Process.inc:94:10: error: no member named 'mallinfo2' in the global namespace
  mi = ::mallinfo2();
       ~~^
2 errors generated.
This revision was landed with ongoing or failed builds.May 25 2022, 1:57 PM
This revision was automatically updated to reflect the committed changes.