Skip to content

[vcpkg baseline][openal-soft/libmikmod] Fix OSX build#23683

Closed
JackBoosY wants to merge 7 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/fix-baseline-20220321
Closed

[vcpkg baseline][openal-soft/libmikmod] Fix OSX build#23683
JackBoosY wants to merge 7 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/fix-baseline-20220321

Conversation

@JackBoosY
Copy link
Contributor

Fix openal-soft export and usage in libmikmod:

FAILED: libmikmod.3.3.0.dylib 
: && /Library/Developer/CommandLineTools/usr/bin/cc -fPIC -g -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -dynamiclib -Wl,-headerpad_max_install_names -compatibility_version 3.0.0 -current_version 3.3.0 -o libmikmod.3.3.0.dylib -install_name @rpath/libmikmod.3.dylib CMakeFiles/mikmod.dir/drivers/drv_AF.c.o CMakeFiles/mikmod.dir/drivers/drv_aiff.c.o CMakeFiles/mikmod.dir/drivers/drv_ahi.c.o CMakeFiles/mikmod.dir/drivers/drv_aix.c.o CMakeFiles/mikmod.dir/drivers/drv_alsa.c.o CMakeFiles/mikmod.dir/drivers/drv_dart.c.o CMakeFiles/mikmod.dir/drivers/drv_ds.c.o CMakeFiles/mikmod.dir/drivers/drv_esd.c.o CMakeFiles/mikmod.dir/drivers/drv_gp32.c.o CMakeFiles/mikmod.dir/drivers/drv_hp.c.o CMakeFiles/mikmod.dir/drivers/drv_mac.c.o CMakeFiles/mikmod.dir/drivers/drv_nas.c.o CMakeFiles/mikmod.dir/drivers/drv_nos.c.o CMakeFiles/mikmod.dir/drivers/drv_openal.c.o CMakeFiles/mikmod.dir/drivers/drv_osles.c.o CMakeFiles/mikmod.dir/drivers/drv_oss.c.o CMakeFiles/mikmod.dir/drivers/drv_osx.c.o CMakeFiles/mikmod.dir/drivers/drv_pipe.c.o CMakeFiles/mikmod.dir/drivers/drv_psp.c.o CMakeFiles/mikmod.dir/drivers/drv_pulseaudio.c.o CMakeFiles/mikmod.dir/drivers/drv_raw.c.o CMakeFiles/mikmod.dir/drivers/drv_sam9407.c.o CMakeFiles/mikmod.dir/drivers/drv_sdl.c.o CMakeFiles/mikmod.dir/drivers/drv_sgi.c.o CMakeFiles/mikmod.dir/drivers/drv_sndio.c.o CMakeFiles/mikmod.dir/drivers/drv_stdout.c.o CMakeFiles/mikmod.dir/drivers/drv_sun.c.o CMakeFiles/mikmod.dir/drivers/drv_ultra.c.o CMakeFiles/mikmod.dir/drivers/drv_wav.c.o CMakeFiles/mikmod.dir/drivers/drv_win.c.o CMakeFiles/mikmod.dir/drivers/drv_xaudio2.c.o CMakeFiles/mikmod.dir/loaders/load_669.c.o CMakeFiles/mikmod.dir/loaders/load_amf.c.o CMakeFiles/mikmod.dir/loaders/load_asy.c.o CMakeFiles/mikmod.dir/loaders/load_dsm.c.o CMakeFiles/mikmod.dir/loaders/load_far.c.o CMakeFiles/mikmod.dir/loaders/load_gdm.c.o CMakeFiles/mikmod.dir/loaders/load_gt2.c.o CMakeFiles/mikmod.dir/loaders/load_imf.c.o CMakeFiles/mikmod.dir/loaders/load_it.c.o CMakeFiles/mikmod.dir/loaders/load_m15.c.o CMakeFiles/mikmod.dir/loaders/load_med.c.o CMakeFiles/mikmod.dir/loaders/load_mod.c.o CMakeFiles/mikmod.dir/loaders/load_mtm.c.o CMakeFiles/mikmod.dir/loaders/load_okt.c.o CMakeFiles/mikmod.dir/loaders/load_s3m.c.o CMakeFiles/mikmod.dir/loaders/load_stm.c.o CMakeFiles/mikmod.dir/loaders/load_stx.c.o CMakeFiles/mikmod.dir/loaders/load_ult.c.o CMakeFiles/mikmod.dir/loaders/load_umx.c.o CMakeFiles/mikmod.dir/loaders/load_uni.c.o CMakeFiles/mikmod.dir/loaders/load_xm.c.o CMakeFiles/mikmod.dir/mmio/mmalloc.c.o CMakeFiles/mikmod.dir/mmio/mmerror.c.o CMakeFiles/mikmod.dir/mmio/mmio.c.o CMakeFiles/mikmod.dir/depackers/mmcmp.c.o CMakeFiles/mikmod.dir/depackers/pp20.c.o CMakeFiles/mikmod.dir/depackers/s404.c.o CMakeFiles/mikmod.dir/depackers/xpk.c.o CMakeFiles/mikmod.dir/posix/strcasecmp.c.o CMakeFiles/mikmod.dir/playercode/mdreg.c.o CMakeFiles/mikmod.dir/playercode/mdriver.c.o CMakeFiles/mikmod.dir/playercode/mdulaw.c.o CMakeFiles/mikmod.dir/playercode/mloader.c.o CMakeFiles/mikmod.dir/playercode/mlreg.c.o CMakeFiles/mikmod.dir/playercode/mlutil.c.o CMakeFiles/mikmod.dir/playercode/mplayer.c.o CMakeFiles/mikmod.dir/playercode/munitrk.c.o CMakeFiles/mikmod.dir/playercode/mwav.c.o CMakeFiles/mikmod.dir/playercode/npertab.c.o CMakeFiles/mikmod.dir/playercode/sloader.c.o CMakeFiles/mikmod.dir/playercode/virtch.c.o CMakeFiles/mikmod.dir/playercode/virtch2.c.o CMakeFiles/mikmod.dir/playercode/virtch_common.c.o -L/Users/vagrant/Data/installed/x64-osx/debug/lib -framework  CoreAudio  /Users/vagrant/Data/installed/x64-osx/debug/lib/libopenal.a  -lm && :
Undefined symbols for architecture x86_64:
  "_AudioComponentFindNext", referenced from:
      (anonymous namespace)::CoreAudioPlayback::open(char const*) in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::open(char const*) in libopenal.a(coreaudio.cpp.o)
  "_AudioComponentInstanceDispose", referenced from:
      (anonymous namespace)::CoreAudioPlayback::~CoreAudioPlayback() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::~CoreAudioCapture() in libopenal.a(coreaudio.cpp.o)
  "_AudioComponentInstanceNew", referenced from:
      (anonymous namespace)::CoreAudioPlayback::open(char const*) in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::open(char const*) in libopenal.a(coreaudio.cpp.o)
  "_AudioOutputUnitStart", referenced from:
      (anonymous namespace)::CoreAudioPlayback::start() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::start() in libopenal.a(coreaudio.cpp.o)
  "_AudioOutputUnitStop", referenced from:
      (anonymous namespace)::CoreAudioPlayback::stop() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::stop() in libopenal.a(coreaudio.cpp.o)
  "_AudioUnitGetProperty", referenced from:
      (anonymous namespace)::CoreAudioPlayback::reset() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::open(char const*) in libopenal.a(coreaudio.cpp.o)
  "_AudioUnitInitialize", referenced from:
      (anonymous namespace)::CoreAudioPlayback::open(char const*) in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioPlayback::reset() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::open(char const*) in libopenal.a(coreaudio.cpp.o)
  "_AudioUnitRender", referenced from:
      (anonymous namespace)::CoreAudioCapture::RecordProc(unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) in libopenal.a(coreaudio.cpp.o)
  "_AudioUnitSetProperty", referenced from:
      (anonymous namespace)::CoreAudioPlayback::reset() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioCapture::open(char const*) in libopenal.a(coreaudio.cpp.o)
  "_AudioUnitUninitialize", referenced from:
      (anonymous namespace)::CoreAudioPlayback::reset() in libopenal.a(coreaudio.cpp.o)
      (anonymous namespace)::CoreAudioPlayback::~CoreAudioPlayback() in libopenal.a(coreaudio.cpp.o)
  "_CFBundleCopyResourceURL", referenced from:
      ReadALConfig() in libopenal.a(alconfig.cpp.o)
  "_CFBundleGetMainBundle", referenced from:
      ReadALConfig() in libopenal.a(alconfig.cpp.o)
  "_CFURLGetFileSystemRepresentation", referenced from:
      ReadALConfig() in libopenal.a(alconfig.cpp.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
      (anonymous namespace)::LoadConfigFromFile(std::__1::basic_istream<char, std::__1::char_traits<char> >&) in libopenal.a(alconfig.cpp.o)
      SearchDataFiles(char const*, char const*) in libopenal.a(helpers.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find_first_of(char, unsigned long) const in libopenal.a(ambdec.cpp.o)
  "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::rfind(char, unsigned long) const", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find_last_of(char, unsigned long) const in libopenal.a(alconfig.cpp.o)
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find_last_of(char, unsigned long) const in libopenal.a(hrtf.cpp.o)

Related: #21790

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Mar 21, 2022
int main() {return 0;}" HAVE_AL_ALEXT_H)
ENDIF()
- LIST (APPEND EXTRA_LIBS ${OPENAL_LIBRARY})
+ LIST (APPEND EXTRA_LIBS OpenAL::OpenAL stdc++)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openal-soft is a c++ library but libmikmod is c only, so there should be added a libstc++ library.

LilyWangLL
LilyWangLL previously approved these changes Mar 21, 2022
@LilyWangLL LilyWangLL added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Mar 21, 2022
@LilyWangLL LilyWangLL added requires:author-response and removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. labels Mar 22, 2022
@JackBoosY
Copy link
Contributor Author

@dg0yt Please review again?

Copy link
Contributor

@dg0yt dg0yt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm really asked to review, I have a lot of comments...

  • Both ports still use deprecated maintainer functions.
  • The pc files need to be verified. openal.pc lacks Requires.private: libmikmod. And libmikmod.pc probably really needs the C++ standard library to be usable in C projects. (Problem known from other ports.)

- include(FindOpenAL)
- IF (OPENAL_FOUND)
+ find_package(OpenAL CONFIG REQUIRED)
+ IF (1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preferred form of minimal patching would be:

find_package(OPENAL NAMES OpenAL REQUIRED)
set(OPENAL_LIBRARY OpenAL::OpenAL)

This would be all which is needed to get the needed OPENAL_<...> variables.

- LIST (APPEND EXTRA_LIBS ${OPENAL_LIBRARY})
+ LIST (APPEND EXTRA_LIBS OpenAL::OpenAL)
+ if (APPLE)
+ LIST (APPEND EXTRA_LIBS c++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this shouldn't be done here.
I checked OpenALConfig.cmake: OpenAL::OpenAL lacks the link language property. This should be fixed in openal-soft, and libmikmod should be modified to enable CXX in addition to C.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that doesn't help.
Openal contains both c and cxx sources, and cmake will not export the cxx standard library.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't export the library. The consuming CMake project (libmikmod) shall use the C++ linker. To do that, the exporting project (openal-soft) shall export CXX as the linking language, and the consuming project (libmikmod) shall enable CXX language to know the linker binary.

But in the end, you have to hard code the c++ lib into the pc file.

Interesting that Linux didn't complain about missing symbols.

HEAD_REF master
PATCHES
dont-export-symbols-in-static-build.patch
fix-export-libs.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this patch is not needed at all. ${EXTRA_LIBS} ${MATH_LIB} are really private. CMake stills exports them for static linkages as needed (verified on x64-linux).

"port-version": 5,
"description": "OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API.",
"homepage": "https://github.com/kcat/openal-soft",
"license": "GPL-2.0-only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGPL.

"port-version": 11,
"description": "Mikmod is a module player and library supporting many formats, including mod, s3m, it, and xm.",
"homepage": "https://sourceforge.net/projects/mikmod/",
"license": "GPL-2.0-only",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README: LGPL 2.0 or later (plus some extra attribution for parts of the code).

@daschuer
Copy link
Contributor

This PR is pending since one month. @JackBoosY, do you plan to fix the review comments in anytime soon?
I would like to make progress with #21790, or can we just disable the unit test for MacOs and libmikmod?

@JackBoosY
Copy link
Contributor Author

Ah I almost forgot this PR, will continue in these days.

@JackBoosY
Copy link
Contributor Author

@daschuer You can disable it in your PR now.

@daschuer
Copy link
Contributor

It has been already disabled by #23757 so I have just rebased my PR on master.

@LilyWangLL
Copy link
Contributor

Closing this PR since it seems that no progress is being made. Please ping me to reopen if work is still being done.

@LilyWangLL LilyWangLL closed this Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants