make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

ichi01
Posts: 4
Joined: Sat May 12, 2018 8:15 am

make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ichi01 » Sat May 12, 2018 8:44 am

Hi!

I'm on Mac OS X 10.13 High Sierra trying to build hello_world but it always fails with the following error message:

Code: Select all

MacBook-Pro-II:hello_world ms1$ make menuconfig
lxdialog/check-lxdialog.sh -check cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD -lncurses 
cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD   -c -o lxdialog/checklist.o lxdialog/checklist.c
cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD   -c -o lxdialog/util.o lxdialog/util.c
cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD   -c -o lxdialog/inputbox.o lxdialog/inputbox.c
cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD   -c -o lxdialog/textbox.o lxdialog/textbox.c
cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD   -c -o lxdialog/yesno.o lxdialog/yesno.c
cc  -DCURSES_LOC="<ncurses.h>" -DKBUILD_NO_NLS -Wno-format-security  -DLOCALE -MD   -c -o lxdialog/menubox.o lxdialog/menubox.c
cc -o mconf mconf.o zconf.tab.o lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o -lncurses 
Undefined symbols for architecture x86_64:
  "_regcompA", referenced from:
      _sym_re_search in zconf.tab.o
  "_regexecA", referenced from:
      _sym_re_search in zconf.tab.o
  "_regfreeA", referenced from:
      _sym_re_search in zconf.tab.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [mconf] Error 1
There seems to be something wrong reg. 32/64 Bit, at least Undefined symbols for architecture x86_64 and symbol(s) not found for architecture x86_64 do point in this direction, but I can't find any solutions on the web for this particular error message and I'm not deep into C make, link, etc.

I've installed the latest toolchain (xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar) and ESP-IF (2018-05-08) as well as XCODE Version 9.3.1:

Code: Select all

MacBook-Pro-II:hello_world ms1$ cc --version
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
My PATH looks like this:

Code: Select all

MacBook-Pro-II:hello_world ms1$ echo $PATH
/Users/ms1/.rvm/gems/ruby-2.5.1/bin:/Users/ms1/.rvm/gems/ruby-2.5.1@global/bin:/Users/ms1/.rvm/rubies/ruby-2.5.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/MacGPG2/bin:/usr/local/bin:/Users/ms1/bin:/Users/ms1/Programmierung/Projekte/soacsv2mt940/bin:/Users/ms1/Programmierung/esp/xtensa-esp32-elf/bin:/Users/ms1/.rvm/bin
IDF_PATH is set:

Code: Select all

MacBook-Pro-II:hello_world ms1$ echo $IDF_PATH
/Users/ms1/Programmierung/esp/esp-idf
Looking forward to any hints on this!

Regards,
Michael

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ESP_Angus » Mon May 14, 2018 2:58 am

Hi Michael,

It seems like we may need to add an extra step to the docs for this. If you have MacPorts installed, can you try running the "port" command shown here:
https://github.com/espressif/esp-idf/is ... -249794445

There are also some fixes discussed in the thread for HomeBrew.

Will look into reproducing this on a clean Mac OS X installation ASAP.

ichi01
Posts: 4
Joined: Sat May 12, 2018 8:15 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ichi01 » Mon May 14, 2018 7:58 am

Hi!

Many thanks for your reply! I actually saw the mentioned thread and tried it although it did not relate directly to my problem ("Undefined symbols for architecture x86_64"). Unfortunately this did not solve my issue und at least the mentioned Homebrew tap "dupes" is deprecated as of now:

Code: Select all

Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Therefore I'm still looking forward to any hints with this.

Regards,
Michael

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ESP_Angus » Tue May 15, 2018 1:50 am

Hi Michael,

You're right, sorry I missed the distinction.

As it happens a colleague ran a clean install on their High Sierra system yesterday without encountering this problem.

It seems like the problem may be triggered by boost library regex.h being installed into a system include directory. This redefines some symbols in regex.h (normally supplied by system regex library) and renames them to symbols which are only present in the boost libraries. See here:
https://trac.macports.org/ticket/23537
https://trac.macports.org/ticket/21208

ichi01
Posts: 4
Joined: Sat May 12, 2018 8:15 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ichi01 » Tue May 15, 2018 6:47 am

Hi!

Many thanks for this hint; seems to point into the right direction (boost/regex). I followed the advice given in the posts and uninstalled boost with brew uninstall boost and deleted regex.* in /usr/local/include – unfortunately it's still not working...

Any other ideas besides a clean install of Mac OS X? That would be very complicated in my situation...

Regards,
Michael

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ESP_Angus » Thu May 17, 2018 1:20 am

You may need to remove the object files so the build system knows to recompile these object files, as I'm not sure how well it will track these system headers. Try

Code: Select all

rm $IDF_PATH/tools/kconfig/*.o $IDF_PATH/tools/kconfig/*.d $IDF_PATH/tools/kconfig/lxdialog/*.o $IDF_PATH/tools/kconfig/lxdialog/*.d
And see if this helps.

ichi01
Posts: 4
Joined: Sat May 12, 2018 8:15 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ichi01 » Thu May 17, 2018 9:12 am

...many thanks, that did the job; make do run now at my Mac!

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: make fails on Mac OS X 10.13 High Sierra with "Undefined symbols for architecture x86_64"

Postby ESP_Angus » Fri May 18, 2018 2:52 am

Awesome, glad you got it working.

When we have some time, I'll see if there's macro we can detect when a boost regex.h is included, so we can fail the build rather than having it fail at link time.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 87 guests