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

16.0.0 cannot be built with lto using gcc and ld #38335

Closed
dilyanpalauzov opened this issue Apr 21, 2021 · 6 comments
Closed

16.0.0 cannot be built with lto using gcc and ld #38335

dilyanpalauzov opened this issue Apr 21, 2021 · 6 comments
Labels
build Issues and PRs related to build files or the CI. confirmed-bug Issues with confirmed bugs. linux Issues and PRs related to the Linux platform.

Comments

@dilyanpalauzov
Copy link

dilyanpalauzov commented Apr 21, 2021

I call python configure.py --gdb --ninja --enable-lto && ninja -C -v out/Releseas. I tried both with gcc10.2.1+ld2.35 and with gcc10.3.1+ld2.36.50.20210421. In the first case this is Fedora 33 with usr/lib/bfd-plugin/liblto_plugin.so symlinked to /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so . In the latter case it is a Linux from Scratch system with /usr/local/lib/bfd-plugins/liblto_plugin.so symlinked to /usr/local/libexec/gcc/x86_64-pc-linux-gnu/10.3.1/liblto_plugin.so .

Linking mksnapshot fails with undefined reference to 'PushAllRegistersAndIterateStack'.

This is different from #35957, where the error is symbol 'PushAllRegistersAndIterateStack' is already defined.

The complete output is below:

[1/205] c++ -pthread -rdynamic -m64 -m64  -flto=4 -fuse-linker-plugin -ffat-lto-objects  -o mksnapshot -Wl,--start-group obj/deps/v8/src/snapshot/embedded/mksnapshot.embedded-empty.o obj/deps/v8/src/snapshot/embedded/mksnapshot.embedded-file-writer.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-aix.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-base.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-generic.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-mac.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-win.o obj/deps/v8/src/snapshot/mksnapshot.mksnapshot.o obj/deps/v8/src/snapshot/mksnapshot.snapshot-empty.o obj/tools/v8_gypfiles/libv8_base_without_compiler.a obj/tools/v8_gypfiles/libv8_init.a obj/tools/v8_gypfiles/libv8_libbase.a obj/tools/v8_gypfiles/libv8_libplatform.a obj/tools/icu/libicui18n.a obj/tools/icu/libicuucx.a obj/tools/icu/libicudata.a obj/tools/v8_gypfiles/libv8_libsampler.a obj/tools/v8_gypfiles/libv8_zlib.a obj/tools/v8_gypfiles/libv8_compiler.a obj/tools/v8_gypfiles/libv8_initializers.a  -ldl -lrt -Wl,--end-group
FAILED: mksnapshot 
c++ -pthread -rdynamic -m64 -m64  -flto=4 -fuse-linker-plugin -ffat-lto-objects  -o mksnapshot -Wl,--start-group obj/deps/v8/src/snapshot/embedded/mksnapshot.embedded-empty.o obj/deps/v8/src/snapshot/embedded/mksnapshot.embedded-file-writer.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-aix.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-base.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-generic.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-mac.o obj/deps/v8/src/snapshot/embedded/mksnapshot.platform-embedded-file-writer-win.o obj/deps/v8/src/snapshot/mksnapshot.mksnapshot.o obj/deps/v8/src/snapshot/mksnapshot.snapshot-empty.o obj/tools/v8_gypfiles/libv8_base_without_compiler.a obj/tools/v8_gypfiles/libv8_init.a obj/tools/v8_gypfiles/libv8_libbase.a obj/tools/v8_gypfiles/libv8_libplatform.a obj/tools/icu/libicui18n.a obj/tools/icu/libicuucx.a obj/tools/icu/libicudata.a obj/tools/v8_gypfiles/libv8_libsampler.a obj/tools/v8_gypfiles/libv8_zlib.a obj/tools/v8_gypfiles/libv8_compiler.a obj/tools/v8_gypfiles/libv8_initializers.a  -ldl -lrt -Wl,--end-group
In member function ‘Resize’,
    inlined from ‘push_back’ at ../../deps/v8/src/utils/detachable-vector.h:58:13,
    inlined from ‘Enter’ at ../../deps/v8/src/api/api.h:463:30:
../../deps/v8/src/utils/detachable-vector.h:92:20: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   92 |     T* new_data_ = new T[new_capacity];
      |                    ^
../../deps/v8/src/utils/detachable-vector.h: In member function ‘Enter’:
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function ‘Resize’,
    inlined from ‘push_back’ at ../../deps/v8/src/utils/detachable-vector.h:58:13,
    inlined from ‘Enter’ at ../../deps/v8/src/api/api.h:448:28:
../../deps/v8/src/utils/detachable-vector.h:92:20: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   92 |     T* new_data_ = new T[new_capacity];
      |                    ^
../../deps/v8/src/utils/detachable-vector.h: In member function ‘Enter’:
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In function ‘operator new’,
    inlined from ‘init’ at ../../deps/icu-small/source/i18n/rbnf.cpp:1581:56:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘init’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In member function ‘Resize’,
    inlined from ‘push_back’ at ../../deps/v8/src/utils/detachable-vector.h:58:13,
    inlined from ‘EnterMicrotaskContextWrapper’ at ../../deps/v8/src/api/api.h:480:30:
../../deps/v8/src/utils/detachable-vector.h:92:20: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   92 |     T* new_data_ = new T[new_capacity];
      |                    ^
../../deps/v8/src/utils/detachable-vector.h: In function ‘EnterMicrotaskContextWrapper’:
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In function ‘operator new’,
    inlined from ‘locale_available_init’ at ../../deps/icu-small/source/common/locavailable.cpp:72:65:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In function ‘locale_available_init’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
../../deps/icu-small/source/common/uresbund.cpp: In function ‘ures_getFunctionalEquivalent_69’:
../../deps/icu-small/source/common/uresbund.cpp:2909:13: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
 2909 |             uprv_strncpy(result, found, copyLength);
      |             ^
../../deps/icu-small/source/common/uresbund.cpp:2904:23: note: length computed here
 2904 |     length = (int32_t)uprv_strlen(found);
      |                       ^
In function ‘ultag_parse’,
    inlined from ‘ulocimp_forLanguageTag_69’ at ../../deps/icu-small/source/common/uloc_tag.cpp:2787:88:
../../deps/icu-small/source/common/uloc_tag.cpp:2123:21: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
 2123 |                     uprv_strncpy(t->buf, preferredTag, preferredTagLen);
      |                     ^
../../deps/icu-small/source/common/uloc_tag.cpp: In function ‘ulocimp_forLanguageTag_69’:
../../deps/icu-small/source/common/uloc_tag.cpp:2122:46: note: length computed here
 2122 |                     size_t preferredTagLen = uprv_strlen(preferredTag);
      |                                              ^
In function ‘operator new’,
    inlined from ‘umsg_vformat_69’ at ../../deps/icu-small/source/i18n/umsg.cpp:410:58:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In function ‘umsg_vformat_69’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘getEquivalents’ at ../../deps/icu-small/source/common/caniter.cpp:409:52:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘getEquivalents’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
../../deps/icu-small/source/i18n/decNumber.cpp: In function ‘uprv_decNumberLog10_69’:
../../deps/icu-small/source/i18n/decNumber.cpp:1528:14: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 1528 |     w->lsu[1]=1; w->lsu[0]=0;           /* ..  */
      |              ^
../../deps/icu-small/source/i18n/decNumber.h:89: note: at offset 1 to object ‘lsu’ with size 1 declared here
   89 |     decNumberUnit lsu[DECNUMUNITS];
      | 
../../deps/icu-small/source/i18n/decNumber.cpp:1528:14: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 1528 |     w->lsu[1]=1; w->lsu[0]=0;           /* ..  */
      |              ^
../../deps/icu-small/source/i18n/decNumber.h:89: note: at offset 1 to object ‘lsu’ with size 1 declared here
   89 |     decNumberUnit lsu[DECNUMUNITS];
      | 
../../deps/icu-small/source/i18n/decNumber.cpp: In function ‘uprv_decNumberSquareRoot_69’:
../../deps/icu-small/source/i18n/decNumber.cpp:2991:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2991 |         t->lsu[0]=9; t->lsu[1]=1; t->lsu[2]=8;
      |                               ^
../../deps/icu-small/source/i18n/decNumber.h:89: note: at offset 1 to object ‘lsu’ with size 1 declared here
   89 |     decNumberUnit lsu[DECNUMUNITS];
      | 
../../deps/icu-small/source/i18n/decNumber.cpp:2991:44: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2991 |         t->lsu[0]=9; t->lsu[1]=1; t->lsu[2]=8;
      |                                            ^
../../deps/icu-small/source/i18n/decNumber.h:89: note: at offset 2 to object ‘lsu’ with size 1 declared here
   89 |     decNumberUnit lsu[DECNUMUNITS];
      | 
../../deps/icu-small/source/i18n/decNumber.cpp:2974:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2974 |         t->lsu[0]=9; t->lsu[1]=5; t->lsu[2]=2;
      |                               ^
../../deps/icu-small/source/i18n/decNumber.h:89: note: at offset 1 to object ‘lsu’ with size 1 declared here
   89 |     decNumberUnit lsu[DECNUMUNITS];
      | 
../../deps/icu-small/source/i18n/decNumber.cpp:2974:44: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2974 |         t->lsu[0]=9; t->lsu[1]=5; t->lsu[2]=2;
      |                                            ^
../../deps/icu-small/source/i18n/decNumber.h:89: note: at offset 2 to object ‘lsu’ with size 1 declared here
   89 |     decNumberUnit lsu[DECNUMUNITS];
      | 
In function ‘operator new’,
    inlined from ‘newUnicodeStringArray’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In function ‘newUnicodeStringArray’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘assignArray’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In function ‘assignArray’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setYearNames’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0,
    inlined from ‘setYearNames’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:874:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setYearNames’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setZodiacNames’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0,
    inlined from ‘setZodiacNames’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:896:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setZodiacNames’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setEras’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setEras’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setEraNames’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setEraNames’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setNarrowEras’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setNarrowEras’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setMonths’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setMonths’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setShortMonths’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setShortMonths’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setWeekdays’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setWeekdays’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setShortWeekdays’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setShortWeekdays’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
In function ‘operator new’,
    inlined from ‘setAmPmStrings’ at ../../deps/icu-small/source/i18n/dtfmtsym.cpp:243:0:
../../deps/icu-small/source/common/uobject.cpp:62: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   62 |     return uprv_malloc(size);
      | 
../../deps/icu-small/source/common/uobject.cpp: In member function ‘setAmPmStrings’:
../../deps/icu-small/source/common/cmemory.cpp:45: note: in a call to allocation function ‘uprv_malloc_69’ declared here
   45 | uprv_malloc(size_t s) {
      | 
../../deps/icu-small/source/i18n/formattedvalue.cpp: In function ‘ufmtval_getString_69’:
lto1: warning: function may return address of local variable [-Wreturn-local-addr]
../../deps/icu-small/source/i18n/formattedvalue.cpp:205:19: note: declared here
  205 |     UnicodeString readOnlyAlias = impl->fFormattedValue->toTempString(*ec);
      |                   ^
In member function ‘Resize’,
    inlined from ‘push_back’ at ../../deps/v8/src/utils/detachable-vector.h:58:13,
    inlined from ‘ExecuteStartFunction’ at ../../deps/v8/src/api/api.h:463:30:
../../deps/v8/src/utils/detachable-vector.h:92:20: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   92 |     T* new_data_ = new T[new_capacity];
      |                    ^
../../deps/v8/src/utils/detachable-vector.h: In member function ‘ExecuteStartFunction’:
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
../../deps/v8/src/deoptimizer/deoptimizer.cc: In member function ‘DoComputeOutputFrames’:
../../deps/v8/src/deoptimizer/deoptimizer.cc:916:40: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  916 |   output_ = new FrameDescription*[count];
      |                                        ^
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
../../deps/v8/src/deoptimizer/deoptimizer.cc:916:40: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  916 |   output_ = new FrameDescription*[count];
      |                                        ^
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function ‘Resize’,
    inlined from ‘push_back’ at ../../deps/v8/src/utils/detachable-vector.h:58:13,
    inlined from ‘SaveContext’ at ../../deps/v8/src/api/api.h:448:28,
    inlined from ‘__ct_base ’ at ../../deps/v8/src/api/api-inl.h:158:26:
../../deps/v8/src/utils/detachable-vector.h:92:20: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   92 |     T* new_data_ = new T[new_capacity];
      |                    ^
../../deps/v8/src/utils/detachable-vector.h: In member function ‘__ct_base ’:
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
In member function ‘Resize’,
    inlined from ‘push_back’ at ../../deps/v8/src/utils/detachable-vector.h:58:13,
    inlined from ‘SaveContext’ at ../../deps/v8/src/api/api.h:448:28,
    inlined from ‘__ct_base ’ at ../../deps/v8/src/api/api-inl.h:158:26:
../../deps/v8/src/utils/detachable-vector.h:92:20: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
   92 |     T* new_data_ = new T[new_capacity];
      |                    ^
../../deps/v8/src/utils/detachable-vector.h: In member function ‘__ct_base ’:
/usr/include/c++/10/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^
/usr/bin/ld: /tmp/mksnapshot.exDabh.ltrans53.ltrans.o: in function `cppgc::internal::MarkerBase::VisitRoots(cppgc::EmbedderStackState)':
<artificial>:(.text+0x12d90): undefined reference to `PushAllRegistersAndIterateStack'
/usr/bin/ld: /tmp/mksnapshot.exDabh.ltrans53.ltrans.o: in function `heap::base::Stack::IteratePointers(heap::base::StackVisitor*) const':
<artificial>:(.text+0x5676): undefined reference to `PushAllRegistersAndIterateStack'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
@jasnell
Copy link
Member

jasnell commented Apr 21, 2021

/cc @joyeecheung

@jasnell jasnell added build Issues and PRs related to build files or the CI. confirmed-bug Issues with confirmed bugs. linux Issues and PRs related to the Linux platform. labels Apr 21, 2021
@dilyanpalauzov dilyanpalauzov changed the title 16.0.0 cannot be build with lto with gcc and ld 16.0.0 cannot be built with lto using gcc and ld Apr 22, 2021
@joyeecheung
Copy link
Member

It looks like an issue within V8, can you try building V8 only using make v8?

@joyeecheung
Copy link
Member

Oh, right, the LTO flags need to be included. In that case, can you try python configure.py --gdb --ninja --enable-lto && ninja -C out/Release v8_snapshot?

@joyeecheung
Copy link
Member

Just saw #38346 , this seem to be caused by our gyp file, never mind

gengjiawen pushed a commit that referenced this issue Apr 29, 2021
"PushAllRegistersAndIterateStack" is implemented in assembly and
called from "stack.cc" via 'extern "C"'. [1]

However, LTO does not work well with symbol usage from assembly. [2]

This change workarounds the issue by disabling LTO for the target.

With GCC 10 and "./configure --enable-lto", compilation succeeds
after this change.

[1] v8/v8@c10863153
[2] https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ#Symbol_usage_from_assembly_language

Refs: #35957
Refs: #38335
Signed-off-by: Jesse Chan <[email protected]>

PR-URL: #38346
Refs: #35957
Refs: #38335
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
@gengjiawen
Copy link
Member

Landed in master.

targos pushed a commit that referenced this issue Apr 29, 2021
"PushAllRegistersAndIterateStack" is implemented in assembly and
called from "stack.cc" via 'extern "C"'. [1]

However, LTO does not work well with symbol usage from assembly. [2]

This change workarounds the issue by disabling LTO for the target.

With GCC 10 and "./configure --enable-lto", compilation succeeds
after this change.

[1] v8/v8@c10863153
[2] https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ#Symbol_usage_from_assembly_language

Refs: #35957
Refs: #38335
Signed-off-by: Jesse Chan <[email protected]>

PR-URL: #38346
Refs: #35957
Refs: #38335
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
@ArchangeGabriel
Copy link

I’m having this issue too when building 16.3.2 in Arch Linux. We recently switched the distro to build with LTO by default, so it would seems that this either regressed or that LTO does not get disabled properly for this target?

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Jan 22, 2022
LTO disabled because of nodejs/node#38335


git-svn-id: file:///srv/repos/svn-community/svn@1113506 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Jan 22, 2022
LTO disabled because of nodejs/node#38335

git-svn-id: file:///srv/repos/svn-community/svn@1113506 9fca08f4-af9d-4005-b8df-a31f2cc04f65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. confirmed-bug Issues with confirmed bugs. linux Issues and PRs related to the Linux platform.
Projects
None yet
Development

No branches or pull requests

5 participants