XCode build fails to link #109598

Closed
opened 2023-07-01 19:50:20 +02:00 by Loren Osborn · 18 comments

System Information
Operating system: macOS 13.4.1 (22F82) on x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 5500M
XCode 14.3.1 (14E300c)

Blender Version
Broken: master 2023-06-30 (commit 3ece687)
Worked: (will try to determine this later)

Short description of error
XCode build fails to link

  1. Follow provided instructions to build in XCode.

  2. Use workaround cmake . -B ../build_xcode/ -G "Xcode" -T buildsystem=1 to generate XCode project files.

  3. setup schemes as instructed

  4. build the install scheme as instructed

Build Fails

XCode build is failing to link because symbols _BLI_mutex_init, _BLI_mutex_unlock and _BLI_mutex_lock referenced from _BLI_mempool_create, _mempool_asan_unlock and _mempool_asan_lockrespectively.

This is the actual error from xcode:

makesdna
Undefined symbol: _BLI_mutex_init

Undefined symbol: _BLI_mutex_lock

Undefined symbol: _BLI_mutex_unlock

Linker command failed with exit code 1 (use -v to see invocation)

**System Information** Operating system: macOS 13.4.1 (22F82) on x86_64-i386-64bit 64 Bits Graphics card: AMD Radeon Pro 5500M XCode 14.3.1 (14E300c) **Blender Version** Broken: master 2023-06-30 (commit 3ece687) Worked: (will try to determine this later) **Short description of error** XCode build fails to link 1) Follow provided instructions to build in XCode. 2) Use workaround `cmake . -B ../build_xcode/ -G "Xcode" -T buildsystem=1` to generate XCode project files. 3) setup schemes as instructed 4) build the `install` scheme as instructed **Build Fails** XCode build is failing to link because symbols `_BLI_mutex_init`, `_BLI_mutex_unlock` and `_BLI_mutex_lock` referenced from `_BLI_mempool_create`, `_mempool_asan_unlock` and `_mempool_asan_lock`respectively. **This is the actual error from xcode**: makesdna Undefined symbol: _BLI_mutex_init Undefined symbol: _BLI_mutex_lock Undefined symbol: _BLI_mutex_unlock Linker command failed with exit code 1 (use -v to see invocation)
Loren Osborn added the
Type
Report
Status
Needs Triage
Severity
Normal
labels 2023-07-01 19:50:20 +02:00
Iliya Katushenock added the
Interest
Platforms, Builds & Tests
label 2023-07-01 19:50:55 +02:00
Author

Looks like this might be linked to the WITH_COMPILER_ASAN compiler option.

Looks like this might be linked to the `WITH_COMPILER_ASAN` compiler option.
Member

@brecht , can you check?

@brecht , can you check?
Member

Usually Issues building blender are not handled on the bugtracker, please report this here https://devtalk.blender.org/c/building-blender/11

But since this already had some conversation, will keep open for the module to decide on how to proceed.

Usually Issues building blender are not handled on the bugtracker, please report this here https://devtalk.blender.org/c/building-blender/11 But since this already had some conversation, will keep open for the module to decide on how to proceed.

Does it happens also without the -T buildsystem=1 workaround, now that there is a solution for #109596?

If it's an issue with the old build system only, it's not worth fixing.

Does it happens also without the `-T buildsystem=1` workaround, now that there is a solution for #109596? If it's an issue with the old build system only, it's not worth fixing.

Does it happens also without the -T buildsystem=1 workaround, now that there is a solution for #109596?

If it's an issue with the old build system only, it's not worth fixing.

If I try the workaround on M1 Mac I got the attached error.

But I am a complete beginner, maybe my setup ist not correct.

> Does it happens also without the `-T buildsystem=1` workaround, now that there is a solution for #109596? > > If it's an issue with the old build system only, it's not worth fixing. If I try the workaround on M1 Mac I got the attached error. But I am a complete beginner, maybe my setup ist not correct.

Remove the ../build_xcode directory to get a completely clean build.

Remove the `../build_xcode` directory to get a completely clean build.

Remove the ../build_xcode directory to get a completely clean build.

Thank you, that works perfectly now.

> Remove the `../build_xcode` directory to get a completely clean build. Thank you, that works perfectly now.

Now I got this error. I have made make update before.

Now I got this error. I have made make update before.
Author

Does it happens also without the -T buildsystem=1 workaround, now that there is a solution for #109596?

If it's an issue with the old build system only, it's not worth fixing.

With @LazyDodo ‘s fix to #109596 it still fails to link. (But if I turn off the address sanitization in the scheme settings , the problem goes away.)

[This is from memory from last night, but I will verify.]

> Does it happens also without the `-T buildsystem=1` workaround, now that there is a solution for #109596? > > If it's an issue with the old build system only, it's not worth fixing. With @LazyDodo ‘s fix to #109596 it still fails to link. (But if I turn off the address sanitization in the scheme settings , the problem goes away.) [This is from memory from last night, but I will verify.]

The creation of the XCode project works for me now. But the build process of the XCode project itself failed. I'm not sure if the problem is with my system. I'll try a full cleanup of my local repository later.

The creation of the XCode project works for me now. But the build process of the XCode project itself failed. I'm not sure if the problem is with my system. I'll try a full cleanup of my local repository later.

I didn't run into build issue with Xcode, either with or without ASAN. This was with Xcode 4.3.1.

For the mutex link errors encountered by @linux_dr , source/blender/makesrna/intern/CMakeLists.txt contains code that checks WITH_COMPILER_ASAN is enabled and if so adds threads.cc. Maybe you are building with ASAN support, but enabled through Xcode rather than WITH_COMPILER_ASAN? That could explain why that files is missing. We could always add threads.cc to solve that.

For the opencolorio issue encountered by @Thorsten-Kreutz I'm not sure what happened, maybe attach the complete build log.

I didn't run into build issue with Xcode, either with or without ASAN. This was with Xcode 4.3.1. For the mutex link errors encountered by @linux_dr , `source/blender/makesrna/intern/CMakeLists.txt` contains code that checks `WITH_COMPILER_ASAN` is enabled and if so adds `threads.cc`. Maybe you are building with ASAN support, but enabled through Xcode rather than `WITH_COMPILER_ASAN`? That could explain why that files is missing. We could always add `threads.cc` to solve that. For the opencolorio issue encountered by @Thorsten-Kreutz I'm not sure what happened, maybe attach the complete build log.

For the opencolorio issue encountered by @Thorsten-Kreutz I'm not sure what happened, maybe attach the complete build log.

s. Attached Log

> > For the opencolorio issue encountered by @Thorsten-Kreutz I'm not sure what happened, maybe attach the complete build log. s. Attached Log
Author

For the mutex link errors encountered by @linux_dr , source/blender/makesrna/intern/CMakeLists.txt contains code that checks WITH_COMPILER_ASAN is enabled and if so adds threads.cc. Maybe you are building with ASAN support, but enabled through Xcode rather than WITH_COMPILER_ASAN? That could explain why that files is missing. We could always add threads.cc to solve that.

Yes, I didn’t explicitly enable ASAN when building the project. That does explain the problem. As a user building blender I would expect one of the following:

  • creating the project from CMake without ASAN support should disable address sanitization as an option in the GUI
  • building the project (without ASAN enabled in CMake) with the address sanitizer option on in the GUI forces an error indicating how to regenerate the project with CMake with ASAN support enabled.
  • creating the Xcode project from CMake should force ASAN support if the address sanitizer option isn’t disablable
  • creating the Xcode project from CMake with ASAN support (explicitly) makes the address sanitizer option in the GUI on by default
  • changing the address sanitizer option in the GUI to update the CMake output files to enable ASAN support as needed.

I don’t expect all of these are possible. I think the last option is probably closest to user intent. I’m sure I’m not a typical user, so this is only my estimation of user expectation, but one of these is probably doable without too much effort?

Thanks again for all your hard work and dedication!

-Loren

> For the mutex link errors encountered by @linux_dr , `source/blender/makesrna/intern/CMakeLists.txt` contains code that checks `WITH_COMPILER_ASAN` is enabled and if so adds `threads.cc`. Maybe you are building with ASAN support, but enabled through Xcode rather than `WITH_COMPILER_ASAN`? That could explain why that files is missing. We could always add `threads.cc` to solve that. Yes, I didn’t explicitly enable ASAN when building the project. That does explain the problem. As a **user** building blender I would expect one of the following: * creating the project from CMake without ASAN support should disable address sanitization as an option in the GUI * building the project (without ASAN enabled in CMake) with the address sanitizer option on in the GUI forces an error indicating how to regenerate the project with CMake with ASAN support enabled. * creating the Xcode project from CMake should force ASAN support if the address sanitizer option isn’t disablable * creating the Xcode project from CMake with ASAN support (explicitly) makes the address sanitizer option in the GUI on by default * changing the address sanitizer option in the GUI to update the CMake output files to enable ASAN support as needed. I don’t expect all of these are possible. I think the last option is probably closest to user intent. I’m sure I’m not a typical user, so this is only **my** estimation of user expectation, but one of these is **probably** doable without too much effort? Thanks again for all your hard work and dedication! -Loren
Author

For the opencolorio issue encountered by @Thorsten-Kreutz I'm not sure what happened, maybe attach the complete build log.

s. Attached Log

I don’t know if it matters (to the issue tracking system) but these definitely seem like two distinct issues.

> > > > For the opencolorio issue encountered by @Thorsten-Kreutz I'm not sure what happened, maybe attach the complete build log. > > s. Attached Log > I don’t know if it matters (to the issue tracking system) but these definitely seem like two distinct issues.

Yes, the creation of the XCode Project works for me now. But the build errors are new. However, this only affects the compile process from XCode. The traditional build via the command line works without any problems.

Yes, the creation of the XCode Project works for me now. But the build errors are new. However, this only affects the compile process from XCode. The traditional build via the command line works without any problems.
Blender Bot added
Status
Resolved
and removed
Status
Needs Info from Developers
labels 2023-07-04 15:22:43 +02:00

@linux_dr I don't see a practical way to sync the Xcode and CMake ASAN options, I just fixed the build to work with both.

@Thorsten-Kreutz, it's unclear to me why that is happening. Can you try a complete clean build folder and Xcode project, and then:

  • Select bf_ocio_shaders as the target in Xcode
  • Build
  • Go to View > Navigator > Reports
  • Select the build report for bf_ocio_shaders, Export and attach it here
@linux_dr I don't see a practical way to sync the Xcode and CMake ASAN options, I just fixed the build to work with both. @Thorsten-Kreutz, it's unclear to me why that is happening. Can you try a complete clean build folder and Xcode project, and then: * Select `bf_ocio_shaders` as the target in Xcode * Build * Go to View > Navigator > Reports * Select the build report for `bf_ocio_shaders`, Export and attach it here

@Thorsten-Kreutz, it's unclear to me why that is happening. Can you try a complete clean build folder and Xcode project, and then:

  • Select bf_ocio_shaders as the target in Xcode
  • Build
  • Go to View > Navigator > Reports
  • Select the build report for bf_ocio_shaders, Export and attach it here

There seems to be a bug in my XCode version, there is an update. Please excuse the time you have taken up for me. You can ignore this error. Thank you and have a nice evening.

> @Thorsten-Kreutz, it's unclear to me why that is happening. Can you try a complete clean build folder and Xcode project, and then: > * Select `bf_ocio_shaders` as the target in Xcode > * Build > * Go to View > Navigator > Reports > * Select the build report for `bf_ocio_shaders`, Export and attach it here There seems to be a bug in my XCode version, there is an update. Please excuse the time you have taken up for me. You can ignore this error. Thank you and have a nice evening.
Author

@linux_dr I don't see a practical way to sync the Xcode and CMake ASAN options, I just fixed the build to work with both.

Like I said, that would likely make the most sense, but it may very well not be possible. I think turning ASAN on for all XCode builds, so that it works either way, makes sense to me... Thank you

> @linux_dr I don't see a practical way to sync the Xcode and CMake ASAN options, I just fixed the build to work with both. Like I said, that would likely make the most sense, but it may very well not be possible. I think turning ASAN on for all XCode builds, so that it works either way, makes sense to me... Thank you
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109598
No description provided.