emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.89k stars 3.32k forks source link

Incorrect Windows header #17796

Open serkkz opened 2 years ago

serkkz commented 2 years ago

I am building the "OpenAL" library used windows using "Ninja. However, when compiling, I get the wrong header soundcard.h, which refers to Unix systems.

In short, the wrong header is supplied with Emscripten for Windows. I took the header from here and it worked.

Version: 3.1.20

Adding directories to PATH:
PATH += D:\emsdk
PATH += D:\emsdk\upstream\emscripten
PATH += D:\emsdk\node\14.18.2_64bit\bin

Setting environment variables:
PATH = D:\emsdk;D:\emsdk\upstream\emscripten;D:\emsdk\node\14.18.2_64bit\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\ninja;C:\Users\sereg\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\sereg\AppData\Local\Programs\Python\Python38\;C:\Users\sereg\AppData\Local\Microsoft\WindowsApps;D:\Panda3D-1.10.10-x64\python;D:\Panda3D-1.10.10-x64\python\Scripts;D:\Panda3D-1.10.10-x64\bin;C:\Program Files\CMake\bin
EMSDK = D:/emsdk
EM_CONFIG = D:\emsdk\.emscripten
EMSDK_NODE = D:\emsdk\node\14.18.2_64bit\bin\node.exe
EMSDK_PYTHON = D:\emsdk\python\3.9.2-nuget_64bit\python.exe
JAVA_HOME = D:\emsdk\java\8.152_64bit
Clearing existing environment variable: EMSDK_PY
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.20 (5d878c99921ec247d34fb26a20b5a13d60d69e93)
clang version 16.0.0 (https://github.com/llvm/llvm-project 75767a0f9a926641edbef08e31ec2148ff45da67)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: D:\emsdk\upstream\bin

Output:

D:\panda3d-thirdparty\panda3d-thirdparty\build>cmake --build . --config Release --target openal
[2/9] Performing download step (git clone) for 'openal'
Cloning into 'openal'...
HEAD is now at ae4eacf1 Release 1.21.1
[5/9] Performing configure step for 'openal'
CMake Warning at CMakeLists.txt:101 (message):
  ALSOFT_CONFIG is deprecated.  Use ALSOFT_INSTALL_CONFIG instead

CMake Warning at CMakeLists.txt:104 (message):
  ALSOFT_HRTF_DEFS is deprecated.  Use ALSOFT_INSTALL_HRTF_DATA instead

CMake Warning at CMakeLists.txt:107 (message):
  ALSOFT_AMBDEC_PRESETS is deprecated.  Use ALSOFT_INSTALL_AMBDEC_PRESETS
  instead

-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Performing Test HAVE___RESTRICT
-- Performing Test HAVE___RESTRICT - Success
-- Performing Test HAVE_LIBATOMIC
-- Performing Test HAVE_LIBATOMIC - Failed
-- Looking for __android_log_print in log
-- Looking for __android_log_print in log - not found
-- Performing Test HAVE_FNO_MATH_ERRNO
-- Performing Test HAVE_FNO_MATH_ERRNO - Success
-- Performing Test HAVE_GCC_PROTECTED_VISIBILITY
-- Performing Test HAVE_GCC_PROTECTED_VISIBILITY - Failed
-- Performing Test HAVE_GCC_DEFAULT_VISIBILITY
-- Performing Test HAVE_GCC_DEFAULT_VISIBILITY - Success
-- Performing Test HAVE_VISIBILITY_HIDDEN_SWITCH
-- Performing Test HAVE_VISIBILITY_HIDDEN_SWITCH - Success
-- Performing Test HAVE_MSSE2_SWITCH
-- Performing Test HAVE_MSSE2_SWITCH - Failed
-- Looking for xmmintrin.h
-- Looking for xmmintrin.h - not found
-- Looking for emmintrin.h
-- Looking for emmintrin.h - not found
-- Looking for pmmintrin.h
-- Looking for pmmintrin.h - not found
-- Looking for smmintrin.h
-- Looking for smmintrin.h - not found
-- Looking for arm_neon.h
-- Looking for arm_neon.h - found
-- Performing Test HAVE_NEON_INTRINSICS
-- Performing Test HAVE_NEON_INTRINSICS - Success
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for cpuid.h
-- Looking for cpuid.h - not found
-- Looking for intrin.h
-- Looking for intrin.h - not found
-- Looking for guiddef.h
-- Looking for guiddef.h - not found
-- Looking for initguid.h
-- Looking for initguid.h - not found
-- Looking for pow in m
-- Looking for pow in m - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for proc_pidpath
-- Looking for proc_pidpath - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test HAVE_PTHREAD
-- Performing Test HAVE_PTHREAD - Success
-- Looking for pthread_setschedparam
-- Looking for pthread_setschedparam - found
-- Looking for include files pthread.h, pthread_np.h
-- Looking for include files pthread.h, pthread_np.h - not found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - not found
-- Looking for pthread_set_name_np
-- Looking for pthread_set_name_np - not found
-- Looking for getopt
-- Looking for getopt - found
-- Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
-- Found OSS: D:/emsdk/upstream/emscripten/cache/sysroot/include
-- Could NOT find AudioIO (missing: AUDIOIO_INCLUDE_DIR)
-- Could NOT find SoundIO (missing: SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR)
-- Could NOT find PortAudio (missing: PORTAUDIO_LIBRARY PORTAUDIO_INCLUDE_DIR)
-- Could NOT find PulseAudio (missing: PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR)
-- Could NOT find JACK (missing: JACK_LIBRARY JACK_INCLUDE_DIR)
-- Could NOT find OpenSL (missing: OPENSL_LIBRARY OPENSL_INCLUDE_DIR OPENSL_ANDROID_INCLUDE_DIR)
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.37.3.windows.1")
--
Building OpenAL with support for the following backends:
     OSS, WaveFile, Null

Building with support for CPU extensions:
    Default, Neon

-- Embedding HRTF datasets

-- Installing library and headers
-- Installing sample configuration
-- Installing HRTF data files
-- Installing AmbDec presets
--
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ALSOFT_AMBDEC_PRESETS
    ALSOFT_CONFIG
    ALSOFT_ENABLE_SSE2_CODEGEN
    ALSOFT_HRTF_DEFS
    ALSOFT_TESTS
    ANDROID_PLATFORM
    CMAKE_ANDROID_ARCH_ABI
    CMAKE_ANDROID_ARCH_LLVM_TRIPLE
    CMAKE_ANDROID_ARCH_TRIPLE
    SKIP_INSTALL_EXECUTABLES
    SKIP_INSTALL_FILES

-- Build files have been written to: D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal-build
[6/9] Performing build step for 'openal'
FAILED: openal-prefix/src/openal-stamp/openal-build D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal-stamp/openal-build
cmd.exe /C "cd /D D:\panda3d-thirdparty\panda3d-thirdparty\build\openal-prefix\src\openal-build && "C:\Program Files\CMake\bin\cmake.exe" --build . && "C:\Program Files\CMake\bin\cmake.exe" -E touch D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal-stamp/openal-build"
[1/83] cmd.exe /C "cd /D D:\panda3d-thirdparty\panda3d-thirdparty\build\openal-prefix\src\openal && "C:\Program Files\CMake\bin\cmake.exe" -D "GIT_EXECUTABLE=C:/Program Files/Git/cmd/git.exe" -D LIB_VERSION=1.21.1 -D LIB_VERSION_NUM=1,21,1,0 -D SRC=D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/version.h.in -D DST=D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal-build/version.h -P D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/version.cmake"
[2/83] Generating hrtf_default.h
[3/83] Building CXX object CMakeFiles/OpenAL.dir/common/almalloc.cpp.o
[4/83] Building CXX object CMakeFiles/OpenAL.dir/common/ringbuffer.cpp.o
[5/83] Building CXX object CMakeFiles/OpenAL.dir/common/dynload.cpp.o
[6/83] Building CXX object CMakeFiles/OpenAL.dir/common/alstring.cpp.o
[7/83] Building CXX object CMakeFiles/OpenAL.dir/common/threads.cpp.o
[8/83] Building CXX object CMakeFiles/OpenAL.dir/common/strutils.cpp.o
[9/83] Building CXX object CMakeFiles/OpenAL.dir/common/polyphase_resampler.cpp.o
[10/83] Building CXX object CMakeFiles/OpenAL.dir/common/alcomplex.cpp.o
[11/83] Building CXX object CMakeFiles/OpenAL.dir/common/alfstream.cpp.o
[12/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/autowah.cpp.o
[13/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/chorus.cpp.o
[14/83] Building CXX object CMakeFiles/OpenAL.dir/al/effect.cpp.o
[15/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/compressor.cpp.o
[16/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/dedicated.cpp.o
[17/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/distortion.cpp.o
[18/83] Building CXX object CMakeFiles/OpenAL.dir/al/auxeffectslot.cpp.o
[19/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/convolution.cpp.o
[20/83] Building CXX object CMakeFiles/OpenAL.dir/al/buffer.cpp.o
[21/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/echo.cpp.o
[22/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/equalizer.cpp.o
[23/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/fshifter.cpp.o
[24/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/pshifter.cpp.o
[25/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/modulator.cpp.o
[26/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/reverb.cpp.o
[27/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/null.cpp.o
[28/83] Building CXX object CMakeFiles/OpenAL.dir/al/effects/vmorpher.cpp.o
[29/83] Building CXX object CMakeFiles/OpenAL.dir/al/extension.cpp.o
[30/83] Building CXX object CMakeFiles/OpenAL.dir/al/error.cpp.o
[31/83] Building CXX object CMakeFiles/OpenAL.dir/alc/buffer_storage.cpp.o
[32/83] Building CXX object CMakeFiles/OpenAL.dir/al/listener.cpp.o
[33/83] Building CXX object CMakeFiles/OpenAL.dir/al/event.cpp.o
[34/83] Building CXX object CMakeFiles/OpenAL.dir/al/state.cpp.o
[35/83] Building CXX object CMakeFiles/OpenAL.dir/al/filter.cpp.o
[36/83] Building CXX object CMakeFiles/OpenAL.dir/alc/bformatdec.cpp.o
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/bformatdec.cpp:4:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/bformatdec.h:13:
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal\core/filters/splitter.h:19:5: warning: definition of implicit copy assignment operator for 'BandSplitterR<float>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    BandSplitterR(const BandSplitterR&) = default;
    ^
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/bformatdec.cpp:80:35: note: in implicit copy assignment operator for 'BandSplitterR<float>' first required here
            mChannelDec[j].mXOver = mChannelDec[0].mXOver;
                                  ^
1 warning generated.
[37/83] Building CXX object CMakeFiles/OpenAL.dir/alc/converter.cpp.o
[38/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effectslot.cpp.o
[39/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/autowah.cpp.o
[40/83] Building CXX object CMakeFiles/OpenAL.dir/alc/alconfig.cpp.o
[41/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/compressor.cpp.o
[42/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/chorus.cpp.o
[43/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/dedicated.cpp.o
[44/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/distortion.cpp.o
[45/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/echo.cpp.o
[46/83] Building CXX object CMakeFiles/OpenAL.dir/alc/alu.cpp.o
[47/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/equalizer.cpp.o
[48/83] Building CXX object CMakeFiles/OpenAL.dir/al/source.cpp.o
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/al/source.cpp:23:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/al/source.h:21:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc\voice.h:15:
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal\core/filters/splitter.h:19:5: warning: definition of implicit copy assignment operator for 'BandSplitterR<float>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    BandSplitterR(const BandSplitterR&) = default;
    ^
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/al/source.cpp:481:36: note: in implicit copy assignment operator for 'BandSplitterR<float>' first required here
            chandata.mAmbiSplitter = splitter;
                                   ^
1 warning generated.
[49/83] Building CXX object CMakeFiles/OpenAL.dir/alc/uiddefs.cpp.o
[50/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/fshifter.cpp.o
[51/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/null.cpp.o
[52/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/modulator.cpp.o
[53/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/convolution.cpp.o
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/effects/convolution.cpp:12:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/alcmain.h:28:
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal\core/filters/splitter.h:19:5: warning: definition of implicit copy assignment operator for 'BandSplitterR<float>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    BandSplitterR(const BandSplitterR&) = default;
    ^
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/effects/convolution.cpp:263:19: note: in implicit copy assignment operator for 'BandSplitterR<float>' first required here
        e.mFilter = splitter;
                  ^
1 warning generated.
[54/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/vmorpher.cpp.o
[55/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/pshifter.cpp.o
[56/83] Building CXX object CMakeFiles/OpenAL.dir/alc/effects/reverb.cpp.o
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/effects/reverb.cpp:32:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/alcmain.h:28:
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal\core/filters/splitter.h:19:5: warning: definition of implicit copy assignment operator for 'BandSplitterR<float>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    BandSplitterR(const BandSplitterR&) = default;
    ^
D:\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1\__algorithm/fill_n.h:28:18: note: in implicit copy assignment operator for 'BandSplitterR<float>' first required here
        *__first = __value_;
                 ^
D:\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1\__algorithm/fill_n.h:37:18: note: in instantiation of function template specialization 'std::__fill_n<BandSplitterR<float> *, long, BandSplitterR<float>>' requested here
   return _VSTD::__fill_n(__first, _VSTD::__convert_to_integral(__n), __value_);
                 ^
D:\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1\__algorithm/fill.h:37:12: note: in instantiation of function template specialization 'std::fill_n<BandSplitterR<float> *, long, BandSplitterR<float>>' requested here
    _VSTD::fill_n(__first, __last - __first, __value_);
           ^
D:\emsdk\upstream\emscripten\cache\sysroot/include/c++/v1\__algorithm/fill.h:45:12: note: in instantiation of function template specialization 'std::__fill<BandSplitterR<float> *, BandSplitterR<float>>' requested here
    _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());
           ^
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/effects/reverb.cpp:676:10: note: in instantiation of function template specialization 'std::fill<BandSplitterR<float> *, BandSplitterR<float>>' requested here
    std::fill(mAmbiSplitter[0].begin()+1, mAmbiSplitter[0].end(), mAmbiSplitter[0][0]);
         ^
1 warning generated.
[57/83] Building CXX object CMakeFiles/OpenAL.dir/alc/alc.cpp.o
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/alc.cpp:60:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal\al/auxeffectslot.h:11:
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/alcmain.h:28:
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal\core/filters/splitter.h:19:5: warning: definition of implicit copy assignment operator for 'BandSplitterR<float>' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    BandSplitterR(const BandSplitterR&) = default;
    ^
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/alc.cpp:2234:44: note: in implicit copy assignment operator for 'BandSplitterR<float>' first required here
                    chandata.mAmbiSplitter = splitter;
                                           ^
1 warning generated.
[58/83] Building CXX object CMakeFiles/OpenAL.dir/alc/backends/base.cpp.o
[59/83] Building CXX object CMakeFiles/OpenAL.dir/alc/backends/oss.cpp.o
FAILED: CMakeFiles/OpenAL.dir/alc/backends/oss.cpp.o
D:\emsdk\upstream\emscripten\em++.bat -DAL_ALEXT_PROTOTYPES -DAL_BUILD_LIBRARY -DAL_LIBTYPE_STATIC -DRESTRICT=__restrict -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/include -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal-build -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/common -fpic -O2 -g -D_DEBUG -Winline -Wunused -Wall -Wextra -Wshadow -Wconversion -Wcast-align -Wpedantic -Wold-style-cast -Wnon-virtual-dtor -Woverloaded-virtual -fno-math-errno -fvisibility=hidden -pthread -std=gnu++14 -MD -MT CMakeFiles/OpenAL.dir/alc/backends/oss.cpp.o -MF CMakeFiles\OpenAL.dir\alc\backends\oss.cpp.o.d -o CMakeFiles/OpenAL.dir/alc/backends/oss.cpp.o -c D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/backends/oss.cpp
In file included from D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/backends/oss.cpp:56:
In file included from D:\emsdk\upstream\emscripten\cache\sysroot/include\sys/soundcard.h:1:
D:\emsdk\upstream\emscripten\cache\sysroot/include\bits/soundcard.h:1:10: fatal error: 'linux/soundcard.h' file not found
#include <linux/soundcard.h>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
em++: error: 'D:/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_SHARED_MEMORY__=1 -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=20 -ID:\emsdk\upstream\emscripten\cache\sysroot\include\SDL --sysroot=D:\emsdk\upstream\emscripten\cache\sysroot -Xclang -iwithsysroot/include\compat -DAL_ALEXT_PROTOTYPES -DAL_BUILD_LIBRARY -DAL_LIBTYPE_STATIC -DRESTRICT=__restrict -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/include -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal-build -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc -ID:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/common -fpic -O2 -g3 -D_DEBUG -Winline -Wunused -Wall -Wextra -Wshadow -Wconversion -Wcast-align -Wpedantic -Wold-style-cast -Wnon-virtual-dtor -Woverloaded-virtual -fno-math-errno -fvisibility=hidden -pthread -std=gnu++14 -MD -MT CMakeFiles/OpenAL.dir/alc/backends/oss.cpp.o -MF CMakeFiles\OpenAL.dir\alc\backends\oss.cpp.o.d -c -matomics -mbulk-memory D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/alc/backends/oss.cpp -o CMakeFiles/OpenAL.dir/alc/backends/oss.cpp.o' failed (returned 1)
[60/83] Building CXX object CMakeFiles/OpenAL.dir/alc/backends/loopback.cpp.o
[61/83] Building CXX object CMakeFiles/OpenAL.dir/alc/helpers.cpp.o
[62/83] Building CXX object CMakeFiles/OpenAL.dir/alc/voice.cpp.o
[63/83] Building CXX object CMakeFiles/OpenAL.dir/core/devformat.cpp.o
[64/83] Building CXX object CMakeFiles/OpenAL.dir/core/bs2b.cpp.o
[65/83] Building CXX object CMakeFiles/OpenAL.dir/alc/backends/null.cpp.o
[66/83] Building CXX object CMakeFiles/OpenAL.dir/alc/backends/wave.cpp.o
[67/83] Building CXX object CMakeFiles/OpenAL.dir/core/bsinc_tables.cpp.o
[68/83] Building CXX object CMakeFiles/OpenAL.dir/core/cpu_caps.cpp.o
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/core/cpu_caps.cpp:136:2: warning: #warning is a C++2b extension [-Wpedantic]
#warning "Assuming NEON run-time support!"
 ^
D:/panda3d-thirdparty/panda3d-thirdparty/build/openal-prefix/src/openal/core/cpu_caps.cpp:136:2: warning: "Assuming NEON run-time support!" [-W#warnings]
2 warnings generated.
[69/83] Building CXX object CMakeFiles/OpenAL.dir/core/except.cpp.o
[70/83] Building CXX object CMakeFiles/OpenAL.dir/alc/panning.cpp.o
[71/83] Building CXX object CMakeFiles/OpenAL.dir/core/ambdec.cpp.o
[72/83] Building CXX object CMakeFiles/OpenAL.dir/alc/hrtf.cpp.o
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.
sbc100 commented 2 years ago

I recently removed these headers from emscripten in #17704. Can you try ./emsdk install tot to confirm the fix?

serkkz commented 2 years ago

I haven't found this file, but where will Emscripten find it if needed when building.

Part of the OpenAL codebase.

#include "alcmain.h"
#include "alconfig.h"
#include "albyte.h"
#include "almalloc.h"
#include "alnumeric.h"
#include "aloptional.h"
#include "alu.h"
#include "core/logging.h"
#include "ringbuffer.h"
#include "threads.h"
#include "vector.h"

#include <sys/soundcard.h>

We see this include, the question is very simple, what to use instead in Emscripten?

sbc100 commented 2 years ago

Emscripten contains a openAL implemention in JavaScript so you probably want to be using that instead of whatever version you are building that is designed to target linux. You should simply be able to include and AL/al.h and use it.

serkkz commented 2 years ago

It's not that simple, just yesterday I talked to an expert on compiling popular engines for the web. The essence of the problem is that game engines usually have their own bindings, which sometimes do not work with the OpenAL version of the library, which is Emscripten.

https://discourse.panda3d.org/t/using-the-cmake-system-for-emscripten-panda-builds/28756/12?u=true

I think I need to try to put together an example with sound for an experiment.

sbc100 commented 2 years ago

With emscripten you can currently choose between using OpenAL, or writing your own JS bindings to talk to WebAudio. You can look at src/library_openal.js for an example of how to do this.

What we don't support is emulating the linux sys/soundcard.h interface, and I'm sure there would be much point is trying to emulate that... but I could be wrong about hat.

midzer commented 10 months ago

I've managed to get OpenAL compiled with Emscripten without -pthread, so far so good.

Everything links fine, twice as good.

Too bad there is a runtime error, because of std::thread in https://github.com/kcat/openal-soft/blob/8c3f111d8a7b5bc6093f483b49bf9ad64a1128b4/al/event.cpp#L157

After all, it was a nice investigation. I stick to shipped -lopenal for now and hack my way around other issues :)