Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Undefined reference to GC_throw_bad_alloc() #77

Description

@HertzDevil

Today I started receiving this error in Bindgen after performing a system update which bumps my libgc's version to 8.0.4:

/usr/bin/ld: ... /spec/integration/tmp/../tmp/instance_properties.o: in function `operator new(unsigned long, GCPlacement, void (*)(void*, void*), void*)':
instance_properties.cpp:(.text._Znwm11GCPlacementPFvPvS0_ES0_[_Znwm11GCPlacementPFvPvS0_ES0_]+0xc6): undefined reference to `GC_throw_bad_alloc()'
collect2: error: ld returned 1 exit status

This is due to bdwgc/bdwgc#268 (comment). According to that issue there are 3 solutions:

  • Add -lgccpp to everywhere in Bindgen that has -lgc;
  • Add -lgctba to everywhere in Bindgen that has -lgc;
  • Add #define GC_NEW_ABORTS_ON_OOM prior to #include <gc/gc_cpp.h>.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions