[macOS] install_name_tool fails for cef dylib

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

[macOS] install_name_tool fails for cef dylib

Postby linuxcef07 » Thu Jun 13, 2024 8:52 am

I have successfully build cef 124.0.6367.60 for macOS arm64 platform.
Now, I am trying to build cefsimple through scon script by linking built dylib in my project.
Internally it runs install_name_tool command on cef lib which is failing with below error

Code: Select all
Change install name for libEGL.dylib,
RUN: install_name_tool -id /Users/satishk2/workspace/cart/bora/build/package/CONAN/hcmac/Release/macos-xcode15.2-universal/cef_mac/124.0.6367.60/lib/libEGL.dylib /Users/satishk2/workspace/cart/bora/build/package/CONAN/hcmac/Release/macos-xcode15.2-universal/cef_mac/124.0.6367.60/lib/libEGL.dylib
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: changing install names or rpaths can't be redone for: /Users/satishk2/workspace/cart/bora/build/package/CONAN/hcmac/Release/macos-xcode15.2-universal/cef_mac/124.0.6367.60/lib/libEGL.dylib (for architecture arm64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names)


I already tried ‘headerpad_max_install_names’ link flag with my scon script but still it is failing.
Do I need to rebuilt cef libraries with ‘headerpad_max_install_names’ flag?

Below is sample scon script that I am using to build cefsimple app.

Code: Select all
import os

# Create the construction environment
env = Environment()

# Paths to CEF include and library directories
cef_include_path = os.path.join('cef', 'include')
cef_lib_path = os.path.join('cef', 'libs')

# Source files
sources = [
    'cefsimple.cpp',
    'simple_app.cpp',
    'simple_handler.cpp'
]

# Compiler and linker flags
env.Append(CPPPATH=[cef_include_path])
env.Append(LIBPATH=[cef_lib_path])
env.Append(LIBS=['cef_dll_wrapper', 'cef'])
env.Append(FRAMEWORKS=[
    'Cocoa', 'Carbon', 'CoreGraphics', 'CoreFoundation', 'CoreText', 'CoreServices',
    'IOKit', 'AudioToolbox', 'SystemConfiguration', 'AppKit'
])
env.Append(LINKFLAGS=['-stdlib=libc++', '-Wl,-rpath,' + cef_lib_path, '-headerpad_max_install_names'])

# Build the executable
env.Program(target='cefsimple', source=sources)


I need to build cefsimple source in my project with scon script only. Am I building it in right way?
linuxcef07
Mentor
 
Posts: 83
Joined: Wed Dec 20, 2023 11:57 am

Re: [macOS] install_name_tool fails for cef dylib

Postby magreenblatt » Thu Jun 13, 2024 11:31 am

Internally it runs install_name_tool command on cef lib

That shouldn't be necessary. See https://bitbucket.org/chromiumembedded/ ... uild-steps
magreenblatt
Site Admin
 
Posts: 12742
Joined: Fri May 29, 2009 6:57 pm

Re: [macOS] install_name_tool fails for cef dylib

Postby linuxcef07 » Fri Jun 14, 2024 12:05 pm

Yes, but I am building cefsimple by incorporating in my project and project runs this cmd for all the associated dylibs.
Can I build CEF libs with "headerpad_max_install_names" linker flag? If yes, can you please share which file need to be modified with given linker flag?
Thanks.
linuxcef07
Mentor
 
Posts: 83
Joined: Wed Dec 20, 2023 11:57 am

Re: [macOS] install_name_tool fails for cef dylib

Postby magreenblatt » Fri Jun 14, 2024 12:14 pm

project runs this cmd for all the associated dylibs

Your project is doing something incorrect. You should fix that.
magreenblatt
Site Admin
 
Posts: 12742
Joined: Fri May 29, 2009 6:57 pm

Re: [macOS] install_name_tool fails for cef dylib

Postby linuxcef07 » Fri Jun 14, 2024 12:18 pm

Yes, I am fixing that part in my project but parallelly wanted to check if I can fix this issue by building cef libs with "headerpad_max_install_names" linker flag.
Thanks.
linuxcef07
Mentor
 
Posts: 83
Joined: Wed Dec 20, 2023 11:57 am

Re: [macOS] install_name_tool fails for cef dylib

Postby magreenblatt » Fri Jun 14, 2024 12:29 pm

linuxcef07 wrote:parallelly wanted to check if I can fix this issue by building cef libs with "headerpad_max_install_names" linker flag.

Maybe. I have not tried it.
magreenblatt
Site Admin
 
Posts: 12742
Joined: Fri May 29, 2009 6:57 pm

Re: [macOS] install_name_tool fails for cef dylib

Postby linuxcef07 » Thu Jun 27, 2024 6:13 am

Thanks @magreenblatt, I have fixed this issue in my project.
linuxcef07
Mentor
 
Posts: 83
Joined: Wed Dec 20, 2023 11:57 am


Return to Support Forum

Who is online

Users browsing this forum: aligre and 19 guests