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

aix: build failure with linker error in debug mode #14080

Closed
gireeshpunathil opened this issue Jul 5, 2017 · 11 comments
Closed

aix: build failure with linker error in debug mode #14080

gireeshpunathil opened this issue Jul 5, 2017 · 11 comments
Assignees
Labels
aix Issues and PRs related to the AIX platform. build Issues and PRs related to build files or the CI.

Comments

@gireeshpunathil
Copy link
Member

  • Version: v9.0.0-pre
  • Platform: AIX
  • Subsystem: build
ld: 0711-317 ERROR: Undefined symbol: vtable for v8::base::PosixTimezoneCache
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
gmake: *** [node/out/Debug/mksnapshot] Error 1
rm e593a2578c78c7c5200c07a18c22644588ff3c6e.intermediate
@gireeshpunathil
Copy link
Member Author

-bnoquiet flag produced this info:

ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing Symbol
 ----------------------------------------------------------------------------------------------
 vtable for v8::base::PosixTimezoneCache [136]   ER PR ../deps/v8/src/base/platform/platform-aix.cc(node/out/Debug/obj.target/deps/v8/src/libv8_libbase.a[platform-aix.o])
                                   00005820 .data    R_POS    [4730]  <_ZTVN2v84base18PosixTimezoneCacheE.P16>
ER: The return code is 8.
ld: 0711-317 ERROR: Undefined symbol: vtable for v8::base::PosixTimezoneCache
collect2: error: ld returned 8 exit status

@gireeshpunathil
Copy link
Member Author

-O3 build fine, while -O0 throws up the above error.
Self-assigning, but feel free to jump in.

@gireeshpunathil gireeshpunathil self-assigned this Jul 5, 2017
@gireeshpunathil gireeshpunathil added aix Issues and PRs related to the AIX platform. build Issues and PRs related to build files or the CI. labels Jul 5, 2017
@gireeshpunathil
Copy link
Member Author

smallest code that reproduces the error, with the class heirarchy retained:

class TimezoneCache {
 public:
  virtual void foo() = 0;
  virtual ~TimezoneCache() {}
};

class PosixTimezoneCache : public TimezoneCache {
 public:
  void foo() override;
  ~PosixTimezoneCache() override {}
};

class AIXTimezoneCache : public PosixTimezoneCache {
  void foo() override;
  ~AIXTimezoneCache() override {}
};

void AIXTimezoneCache::foo() {}

int main() {
}

Resolution of the function foo is what causes the issue - looks like PosixTimezoneCache is deemed abstract and no vtable is created for it.

This code fails in Linux too with similar linker error:

/tmp/ccW4gs0R.o: In function `PosixTimezoneCache::~PosixTimezoneCache()':
a.cc:(.text._ZN18PosixTimezoneCacheD2Ev[_ZN18PosixTimezoneCacheD5Ev]+0x13): undefined reference to `vtable for PosixTimezoneCache'
/tmp/ccW4gs0R.o:(.rodata._ZTI16AIXTimezoneCache[_ZTI16AIXTimezoneCache]+0x10): undefined reference to `typeinfo for PosixTimezoneCache'
collect2: error: ld returned 1 exit status

But I guess the scenario does not affect Linux, as it uses PosixTimezoneCache, with no next level inheritance.

If I define foo inline within the AIXTimezoneCache class the problem goes away, don't know what it means.

@gireeshpunathil
Copy link
Member Author

-fno-rtti flag took away the first problem -
undefined reference to vtable for PosixTimezoneCache'

@bnoordhuis
Copy link
Member

Can this be closed?

@gireeshpunathil
Copy link
Member Author

@bnoordhuis - no I guess, @jbajwa is working on this with v8

@jbajwa
Copy link
Contributor

jbajwa commented Aug 3, 2017

@gireeshpunathil
Hi Gireesh, as per the v8 bug, the fix is in 6.1 CL and the backport to 6.0/5.9 was rejected. So the only option is to float the patch in node (not sure what the process for that is) until v8 is upgraded to 6.1.

@bnoordhuis
Copy link
Member

@jbajwa Cherry-pick the patch to deps/v8 and open a PR. See git log deps/v8 for what the commit log should look like. Ping me here or on Slack (if I'm around) if you need assistance.

@jbajwa
Copy link
Contributor

jbajwa commented Aug 3, 2017

@bnoordhuis
Thank you, I will do that now.

@gibfahn
Copy link
Member

gibfahn commented Aug 5, 2017

@jbajwa FWIW I think this is the relevant section of the guide: https://github.com/nodejs/node/blob/master/doc/guides/maintaining-V8.md#backporting-to-abandoned-branches

@richardlau
Copy link
Member

This was fixed by 8096791.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aix Issues and PRs related to the AIX platform. build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants