Skip to content

Commit

Permalink
For esp32, libstdc++ must come *after* libcxx
Browse files Browse the repository at this point in the history
Get multiple definition errors for `__cxa_guard_acquire`, etc.
  • Loading branch information
mikee47 committed Jun 19, 2024
1 parent 3bbe109 commit 8c0bb87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sming/Arch/Esp32/app.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ else ifeq ($(IDF_VERSION),v5.0)
@printf "\033[47;1;34mNOTE! ESP-IDF 5.0 not recommended for new designs.\033[0m Please consider upgrading to v5.2.\n"
endif

# Force libcxx to appear before libstdc++ because some unwind code is wrapped by libcxx.
LIBS := cxx $(filter-out cxx,$(LIBS))

$(TARGET_OUT): $(COMPONENTS_AR)
$(info $(notdir $(PROJECT_DIR)): Linking $@)
$(Q) $(LD) $(addprefix -L,$(LIBDIRS)) $(LDFLAGS) -Wl,--start-group $(COMPONENTS_AR) $(addprefix -l,$(LIBS)) -Wl,--end-group -o $@
Expand Down

0 comments on commit 8c0bb87

Please sign in to comment.