View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001045 | OpenMPT | libopenmpt | public | 2017-10-17 07:51 | 2017-11-06 15:37 |
Reporter | manx | Assigned To | manx | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | OpenMPT 1.26.14.00 / libopenmpt 0.2-beta27 (upgrade first) | ||||
Target Version | OpenMPT 1.27.02.00 / libopenmpt 0.3.2/0.3.3 (upgrade first) | Fixed in Version | OpenMPT 1.27.02.00 / libopenmpt 0.3.2/0.3.3 (upgrade first) | ||
Summary | 0001045: libopenmpt.pc does not list the C++ standard library in Libs.private | ||||
Description | libopenmpt.pc does not list the C++ standard library in Libs.private which causes static linking to fail. The issue is complicated by the fact that there is no standard reliable way to determine the name of the standard library used by the toolchain.
| ||||
Additional Information | https://lists.freedesktop.org/archives/pkg-config/2016-August/001055.html Other C++ libraries either do not put anything there (libmatroska), or hardcode libstdc++ (libmodplug) or rely on an environment variable (zimg). https://ffmpeg.org/pipermail/ffmpeg-devel/2017-October/218060.html https://www.gnu.org/software/libtool/manual/html_node/C_002b_002b-libraries.html | ||||
Tags | No tags attached. | ||||
Attached Files | static-linking-v2.patch (5,941 bytes)
Index: Makefile =================================================================== --- Makefile (revision 9093) +++ Makefile (working copy) @@ -33,7 +33,12 @@ # LDLIBS # ARFLAGS # +# CXXSTDLIB_LIBS C++ standard library (or libraries) required for static +# linking. This will be put in the pkg-config file +# libopenmpt.pc Libs.private field and used for nothing else. # +# +# # Build flags (provide on each `make` invocation) (defaults are shown): # # DYNLINK=1 Dynamically link examples and openmpt123 against libopenmpt @@ -352,6 +357,9 @@ endif +PC_LIBS_PRIVATE := +PC_LIBS_PRIVATE += $(CXXSTDLIB_LIBS) + ifeq ($(HACK_ARCHIVE_SUPPORT),1) NO_ZLIB:=1 endif @@ -957,7 +965,7 @@ $(VERYSILENT)echo 'Version: $(DIST_LIBOPENMPT_VERSION)' >> $@.tmp $(VERYSILENT)echo 'Requires.private: $(PC_REQUIRES_ZLIB) $(PC_REQUIRES_MPG123) $(PC_REQUIRES_OGG) $(PC_REQUIRES_VORBIS) $(PC_REQUIRES_VORBISFILE)' >> $@.tmp $(VERYSILENT)echo 'Libs: -L$${libdir} -lopenmpt' >> $@.tmp - $(VERYSILENT)echo 'Libs.private: ' >> $@.tmp + $(VERYSILENT)echo 'Libs.private: $(PC_LIBS_PRIVATE)' >> $@.tmp $(VERYSILENT)echo 'Cflags: -I$${includedir}' >> $@.tmp $(VERYSILENT)mv $@.tmp $@ Index: build/autotools/configure.ac =================================================================== --- build/autotools/configure.ac (revision 9093) +++ build/autotools/configure.ac (working copy) @@ -33,6 +33,9 @@ AC_DEFINE([MPT_PACKAGE], [!!MPT_PACKAGE!!], [is package]) +AC_ARG_VAR(CXXSTDLIB_LIBS, [C++ standard library (or libraries) required for static linking. This will be put in the pkg-config file libopenmpt.pc Libs.private field and used for nothing else.]) + + AC_CANONICAL_HOST case $host_os in mingw32*) @@ -59,6 +62,7 @@ LIBOPENMPT_REQUIRES_PRIVATE= LIBOPENMPT_LIBS_PRIVATE= + # Required libopenmpt dependency: zlib ZLIB_PKG= AC_ARG_WITH([zlib], AS_HELP_STRING([--without-zlib], [Disable use of zlib.])) @@ -126,7 +130,7 @@ LIBOPENMPT_REQUIRES_PRIVATE="$ZLIB_PKG $MPG123_PKG $OGG_PKG $VORBIS_PKG $VORBISFILE_PKG" -LIBOPENMPT_LIBS_PRIVATE="" +LIBOPENMPT_LIBS_PRIVATE="$CXXSTDLIB_LIBS" AC_SUBST([LIBOPENMPT_REQUIRES_PRIVATE]) AC_SUBST([LIBOPENMPT_LIBS_PRIVATE]) Index: libopenmpt/dox/changelog.md =================================================================== --- libopenmpt/dox/changelog.md (revision 9093) +++ libopenmpt/dox/changelog.md (working copy) @@ -7,6 +7,12 @@ ### libopenmpt 0.4.0-pre + * [**New**] Autotools `configure` and plain `Makefile` now honor the variable + `CXXSTDLIB_LIBS` which serves the sole purpose of listing the standard + library (or libraries) required for static linking. The contents of this + variable will be put in `libopenmpt.pc` `Libs.private` and used for nothing + else. See \ref libopenmpt_c_staticlinking . + ### libopenmpt 0.3 (2017-09-27) * [**New**] New error handling functionality in the C API, which in particular Index: libopenmpt/dox/packaging.md =================================================================== --- libopenmpt/dox/packaging.md (revision 9093) +++ libopenmpt/dox/packaging.md (working copy) @@ -16,6 +16,8 @@ versions, however it can easily be processed to be compatible by replacing '-' (hyphen) with '~' (tilde). It is recommended that you use this exact transformation if required. + * Read \ref libopenmpt_c_staticlinking and thus possibly pass + `CXXSTDLIB_LIBS` variable to `configure` if appropriate and/or desired. * Use the autotools source package. * Use the default set of dependencies required by the autotools package. * Run the test suite in your build process. Index: libopenmpt/libopenmpt.h =================================================================== --- libopenmpt/libopenmpt.h (revision 9093) +++ libopenmpt/libopenmpt.h (working copy) @@ -111,6 +111,36 @@ * - Consecutive accesses can happen from different threads. * - Different objects can be accessed concurrently from different threads. * + * \section libopenmpt_c_staticlinking Statically linking to libopenmpt + * + * libopenmpt is implemented in C++. This imlies that linking to libopenmpt + * statically requires linking to the C++ runtime and standard library. The + * *highly* preferred and recommended way to do this is by using the C++ + * compiler instead of the platform linker to do the linking. This will do all + * necessary things that are C++ specific (in particular, it will pull in the + * appropriate runtime and/or library). If for whatever reason it is not + * possible to use the C++ compiler for linking, the libopenmpt build system can + * list the required libraries in the pkg-config file `libopenmpt.pc`. However, + * there is no reliable way to determine the name of the require library or + * libraries from within the build system. The libopenmpt autotools `configure` + * and plain `Makefile` honor the custom variable `CXXSTDLIB_LIBS` which serves + * the sole purpose of listing the standard library (or libraries) required for + * static linking. The contents of this variable will be put in `libopenmpt.pc` + * `Libs.private` and used for nothing else. + * + * This problem is inherent to libraries implemented in C++ that can also be used + * without a C++ compiler. Other libraries try to solve that by listing + * `-lstdc++` unconditionally in `Libs.private`. However, that will break + * platforms that use a different C++ standard library (in particular FreeBSD). + * + * See https://lists.freedesktop.org/archives/pkg-config/2016-August/001055.html . + * + * Dymically linking to libopenmpt does not require anything special and will + * work as usual (and exactly as done for libraries implemented in C). + * + * Note: This section does not apply when using Microsoft Visual Studio or + * Andriod NDK ndk-build build systems. + * * \section libopenmpt_c_detailed Detailed documentation * * \ref libopenmpt_c static-linking-v4.patch (5,801 bytes)
Index: Makefile =================================================================== --- Makefile (revision 9114) +++ Makefile (working copy) @@ -33,7 +33,12 @@ # LDLIBS # ARFLAGS # +# CXXSTDLIB_PCLIBSPRIVATE C++ standard library (or libraries) required for +# static linking. This will be put in the pkg-config file +# libopenmpt.pc Libs.private field and used for nothing else. # +# +# # Build flags (provide on each `make` invocation) (defaults are shown): # # DYNLINK=1 Dynamically link examples and openmpt123 against libopenmpt @@ -355,6 +360,9 @@ endif +PC_LIBS_PRIVATE := +PC_LIBS_PRIVATE += $(CXXSTDLIB_PCLIBSPRIVATE) + ifeq ($(HACK_ARCHIVE_SUPPORT),1) NO_ZLIB:=1 endif @@ -960,7 +968,7 @@ $(VERYSILENT)echo 'Version: $(DIST_LIBOPENMPT_VERSION)' >> $@.tmp $(VERYSILENT)echo 'Requires.private: $(PC_REQUIRES_ZLIB) $(PC_REQUIRES_MPG123) $(PC_REQUIRES_OGG) $(PC_REQUIRES_VORBIS) $(PC_REQUIRES_VORBISFILE)' >> $@.tmp $(VERYSILENT)echo 'Libs: -L$${libdir} -lopenmpt' >> $@.tmp - $(VERYSILENT)echo 'Libs.private: ' >> $@.tmp + $(VERYSILENT)echo 'Libs.private: $(PC_LIBS_PRIVATE)' >> $@.tmp $(VERYSILENT)echo 'Cflags: -I$${includedir}' >> $@.tmp $(VERYSILENT)mv $@.tmp $@ Index: build/autotools/configure.ac =================================================================== --- build/autotools/configure.ac (revision 9114) +++ build/autotools/configure.ac (working copy) @@ -33,6 +33,9 @@ AC_DEFINE([MPT_PACKAGE], [!!MPT_PACKAGE!!], [is package]) +AC_ARG_VAR(CXXSTDLIB_PCLIBSPRIVATE, [C++ standard library (or libraries) required for static linking. This will be put in the pkg-config file libopenmpt.pc Libs.private field and used for nothing else.]) + + AC_CANONICAL_HOST case $host_os in mingw32*) @@ -126,7 +129,7 @@ LIBOPENMPT_REQUIRES_PRIVATE="$ZLIB_PKG $MPG123_PKG $OGG_PKG $VORBIS_PKG $VORBISFILE_PKG" -LIBOPENMPT_LIBS_PRIVATE="" +LIBOPENMPT_LIBS_PRIVATE="$CXXSTDLIB_PCLIBSPRIVATE" AC_SUBST([LIBOPENMPT_REQUIRES_PRIVATE]) AC_SUBST([LIBOPENMPT_LIBS_PRIVATE]) Index: libopenmpt/dox/changelog.md =================================================================== --- libopenmpt/dox/changelog.md (revision 9114) +++ libopenmpt/dox/changelog.md (working copy) @@ -7,6 +7,12 @@ ### libopenmpt 0.4.0-pre + * [**New**] Autotools `configure` and plain `Makefile` now honor the variable + `CXXSTDLIB_PCLIBSPRIVATE` which serves the sole purpose of listing the + standard library (or libraries) required for static linking. The contents of + this variable will be put in `libopenmpt.pc` `Libs.private` and used for + nothing else. See \ref libopenmpt_c_staticlinking . + ### libopenmpt 0.3 (2017-09-27) * [**New**] New error handling functionality in the C API, which in particular Index: libopenmpt/dox/packaging.md =================================================================== --- libopenmpt/dox/packaging.md (revision 9114) +++ libopenmpt/dox/packaging.md (working copy) @@ -16,6 +16,9 @@ versions, however it can easily be processed to be compatible by replacing '-' (hyphen) with '~' (tilde). It is recommended that you use this exact transformation if required. + * Read \ref libopenmpt_c_staticlinking and thus possibly pass + `CXXSTDLIB_PCLIBSPRIVATE` variable to `configure` if appropriate and/or + desired. * Use the autotools source package. * Use the default set of dependencies required by the autotools package. * Run the test suite in your build process. Index: libopenmpt/libopenmpt.h =================================================================== --- libopenmpt/libopenmpt.h (revision 9114) +++ libopenmpt/libopenmpt.h (working copy) @@ -111,6 +111,36 @@ * - Consecutive accesses can happen from different threads. * - Different objects can be accessed concurrently from different threads. * + * \section libopenmpt_c_staticlinking Statically linking to libopenmpt + * + * libopenmpt is implemented in C++. This imlies that linking to libopenmpt + * statically requires linking to the C++ runtime and standard library. The + * *highly* preferred and recommended way to do this is by using the C++ + * compiler instead of the platform linker to do the linking. This will do all + * necessary things that are C++ specific (in particular, it will pull in the + * appropriate runtime and/or library). If for whatever reason it is not + * possible to use the C++ compiler for linking, the libopenmpt build system can + * list the required libraries in the pkg-config file `libopenmpt.pc`. However, + * there is no reliable way to determine the name of the require library or + * libraries from within the build system. The libopenmpt autotools `configure` + * and plain `Makefile` honor the custom variable `CXXSTDLIB_PCLIBSPRIVATE` + * which serves the sole purpose of listing the standard library (or libraries) + * required for static linking. The contents of this variable will be put in + * `libopenmpt.pc` `Libs.private` and used for nothing else. + * + * This problem is inherent to libraries implemented in C++ that can also be used + * without a C++ compiler. Other libraries try to solve that by listing + * `-lstdc++` unconditionally in `Libs.private`. However, that will break + * platforms that use a different C++ standard library (in particular FreeBSD). + * + * See https://lists.freedesktop.org/archives/pkg-config/2016-August/001055.html . + * + * Dymically linking to libopenmpt does not require anything special and will + * work as usual (and exactly as done for libraries implemented in C). + * + * Note: This section does not apply when using Microsoft Visual Studio or + * Andriod NDK ndk-build build systems. + * * \section libopenmpt_c_detailed Detailed documentation * * \ref libopenmpt_c static-linking-v5.patch (5,822 bytes)
Index: Makefile =================================================================== --- Makefile (revision 9126) +++ Makefile (working copy) @@ -33,7 +33,12 @@ # LDLIBS # ARFLAGS # +# CXXSTDLIB_PCLIBSPRIVATE C++ standard library (or libraries) required for +# static linking. This will be put in the pkg-config file +# libopenmpt.pc Libs.private field and used for nothing else. # +# +# # Build flags (provide on each `make` invocation) (defaults are shown): # # DYNLINK=1 Dynamically link examples and openmpt123 against libopenmpt @@ -355,6 +360,9 @@ endif +PC_LIBS_PRIVATE := +PC_LIBS_PRIVATE += $(CXXSTDLIB_PCLIBSPRIVATE) + ifeq ($(HACK_ARCHIVE_SUPPORT),1) NO_ZLIB:=1 endif @@ -960,7 +968,7 @@ $(VERYSILENT)echo 'Version: $(DIST_LIBOPENMPT_VERSION)' >> $@.tmp $(VERYSILENT)echo 'Requires.private: $(PC_REQUIRES_ZLIB) $(PC_REQUIRES_MPG123) $(PC_REQUIRES_OGG) $(PC_REQUIRES_VORBIS) $(PC_REQUIRES_VORBISFILE)' >> $@.tmp $(VERYSILENT)echo 'Libs: -L$${libdir} -lopenmpt' >> $@.tmp - $(VERYSILENT)echo 'Libs.private: ' >> $@.tmp + $(VERYSILENT)echo 'Libs.private: $(PC_LIBS_PRIVATE)' >> $@.tmp $(VERYSILENT)echo 'Cflags: -I$${includedir}' >> $@.tmp $(VERYSILENT)mv $@.tmp $@ Index: build/autotools/configure.ac =================================================================== --- build/autotools/configure.ac (revision 9126) +++ build/autotools/configure.ac (working copy) @@ -33,6 +33,9 @@ AC_DEFINE([MPT_PACKAGE], [!!MPT_PACKAGE!!], [is package]) +AC_ARG_VAR(CXXSTDLIB_PCLIBSPRIVATE, [C++ standard library (or libraries) required for static linking. This will be put in the pkg-config file libopenmpt.pc Libs.private field and used for nothing else.]) + + AC_CANONICAL_HOST case $host_os in mingw32*) @@ -126,7 +129,7 @@ LIBOPENMPT_REQUIRES_PRIVATE="$ZLIB_PKG $MPG123_PKG $OGG_PKG $VORBIS_PKG $VORBISFILE_PKG" -LIBOPENMPT_LIBS_PRIVATE="" +LIBOPENMPT_LIBS_PRIVATE="$CXXSTDLIB_PCLIBSPRIVATE" AC_SUBST([LIBOPENMPT_REQUIRES_PRIVATE]) AC_SUBST([LIBOPENMPT_LIBS_PRIVATE]) Index: libopenmpt/dox/changelog.md =================================================================== --- libopenmpt/dox/changelog.md (revision 9126) +++ libopenmpt/dox/changelog.md (working copy) @@ -7,6 +7,12 @@ ### libopenmpt 0.4.0-pre + * [**New**] Autotools `configure` and plain `Makefile` now honor the variable + `CXXSTDLIB_PCLIBSPRIVATE` which serves the sole purpose of listing the + standard library (or libraries) required for static linking. The contents of + this variable will be put in `libopenmpt.pc` `Libs.private` and used for + nothing else. See \ref libopenmpt_c_staticlinking . + * [**Bug**] libopenmpt did not build on Android NDK 15c (and possibly other versions between 12b and 15c as well). Index: libopenmpt/dox/packaging.md =================================================================== --- libopenmpt/dox/packaging.md (revision 9126) +++ libopenmpt/dox/packaging.md (working copy) @@ -18,6 +18,9 @@ transformation if required. * Use the autotools source package. * Use the default set of dependencies required by the autotools package. + * Read \ref libopenmpt_c_staticlinking and thus possibly pass + `CXXSTDLIB_PCLIBSPRIVATE` variable to `configure` if appropriate and/or + desired. * Run the test suite in your build process. * Send any build system improvement patches upstream. * Do not include the libmodplug emulation layer in the default libopenmpt Index: libopenmpt/libopenmpt.h =================================================================== --- libopenmpt/libopenmpt.h (revision 9126) +++ libopenmpt/libopenmpt.h (working copy) @@ -111,6 +111,37 @@ * - Consecutive accesses can happen from different threads. * - Different objects can be accessed concurrently from different threads. * + * \section libopenmpt_c_staticlinking Statically linking to libopenmpt + * + * libopenmpt is implemented in C++. This imlies that linking to libopenmpt + * statically requires linking to the C++ runtime and standard library. The + * **highly preferred and recommended** way to do this is by using the C++ + * compiler instead of the platform linker to do the linking. This will do all + * necessary things that are C++ specific (in particular, it will pull in the + * appropriate runtime and/or library). If for whatever reason it is not + * possible to use the C++ compiler for statically linking against libopenmpt, + * the libopenmpt build system can list the required libraries in the pkg-config + * file `libopenmpt.pc`. However, there is no reliable way to determine the name + * of the required library or libraries from within the build system. The + * libopenmpt autotools `configure` and plain `Makefile` honor the custom + * variable `CXXSTDLIB_PCLIBSPRIVATE` which serves the sole purpose of listing + * the standard library (or libraries) required for static linking. The contents + * of this variable will be put in `libopenmpt.pc` `Libs.private` and used for + * nothing else. + * + * This problem is inherent to libraries implemented in C++ that can also be used + * without a C++ compiler. Other libraries try to solve that by listing + * `-lstdc++` unconditionally in `Libs.private`. However, that will break + * platforms that use a different C++ standard library (in particular FreeBSD). + * + * See https://lists.freedesktop.org/archives/pkg-config/2016-August/001055.html . + * + * Dymically linking to libopenmpt does not require anything special and will + * work as usual (and exactly as done for libraries implemented in C). + * + * Note: This section does not apply when using Microsoft Visual Studio or + * Andriod NDK ndk-build build systems. + * * \section libopenmpt_c_detailed Detailed documentation * * \ref libopenmpt_c | ||||
Has the bug occurred in previous versions? | |||||
Tested code revision (in case you know it) | |||||
Actually, using an environment variable might be more canonical autoconf-style here. |
|
First try. static-v1.patch (5,867 bytes)
Index: Makefile =================================================================== --- Makefile (revision 9093) +++ Makefile (working copy) @@ -33,7 +33,12 @@ # LDLIBS # ARFLAGS # +# CXXSTDLIB_LIBS C++ standard library (or libraries) required for static +# linking. This will be put in the pkg-config file +# libopenmpt.pc Libs.private field and used for nothing else. # +# +# # Build flags (provide on each `make` invocation) (defaults are shown): # # DYNLINK=1 Dynamically link examples and openmpt123 against libopenmpt @@ -352,6 +357,9 @@ endif +PC_LIBS_PRIVATE := +PC_LIBS_PRIVATE += $(CXXSTDLIB_LIBS) + ifeq ($(HACK_ARCHIVE_SUPPORT),1) NO_ZLIB:=1 endif @@ -957,7 +965,7 @@ $(VERYSILENT)echo 'Version: $(DIST_LIBOPENMPT_VERSION)' >> $@.tmp $(VERYSILENT)echo 'Requires.private: $(PC_REQUIRES_ZLIB) $(PC_REQUIRES_MPG123) $(PC_REQUIRES_OGG) $(PC_REQUIRES_VORBIS) $(PC_REQUIRES_VORBISFILE)' >> $@.tmp $(VERYSILENT)echo 'Libs: -L$${libdir} -lopenmpt' >> $@.tmp - $(VERYSILENT)echo 'Libs.private: ' >> $@.tmp + $(VERYSILENT)echo 'Libs.private: $(PC_LIBS_PRIVATE)' >> $@.tmp $(VERYSILENT)echo 'Cflags: -I$${includedir}' >> $@.tmp $(VERYSILENT)mv $@.tmp $@ Index: build/autotools/configure.ac =================================================================== --- build/autotools/configure.ac (revision 9093) +++ build/autotools/configure.ac (working copy) @@ -33,6 +33,9 @@ AC_DEFINE([MPT_PACKAGE], [!!MPT_PACKAGE!!], [is package]) +AC_ARG_VAR(CXXSTDLIB_LIBS, [C++ standard library (or libraries) required for static linking. This will be put in the pkg-config file libopenmpt.pc Libs.private field and used for nothing else.]) + + AC_CANONICAL_HOST case $host_os in mingw32*) @@ -59,6 +62,7 @@ LIBOPENMPT_REQUIRES_PRIVATE= LIBOPENMPT_LIBS_PRIVATE= + # Required libopenmpt dependency: zlib ZLIB_PKG= AC_ARG_WITH([zlib], AS_HELP_STRING([--without-zlib], [Disable use of zlib.])) @@ -126,7 +130,7 @@ LIBOPENMPT_REQUIRES_PRIVATE="$ZLIB_PKG $MPG123_PKG $OGG_PKG $VORBIS_PKG $VORBISFILE_PKG" -LIBOPENMPT_LIBS_PRIVATE="" +LIBOPENMPT_LIBS_PRIVATE="$CXXSTDLIB_LIBS" AC_SUBST([LIBOPENMPT_REQUIRES_PRIVATE]) AC_SUBST([LIBOPENMPT_LIBS_PRIVATE]) Index: libopenmpt/dox/changelog.md =================================================================== --- libopenmpt/dox/changelog.md (revision 9093) +++ libopenmpt/dox/changelog.md (working copy) @@ -7,6 +7,12 @@ ### libopenmpt 0.4.0-pre + * [**New**] Autotools `configure` and plain `Makefile` now honor the variable + `CXXSTDLIB_LIBS` which serves the sole purpose of listing the standard + library (or libraries) required for static linking. The contents of this + variable will be put in `libopenmpt.pc` and used for nothing else. See + \ref libopenmpt_c_staticlinking . + ### libopenmpt 0.3 (2017-09-27) * [**New**] New error handling functionality in the C API, which in particular Index: libopenmpt/dox/packaging.md =================================================================== --- libopenmpt/dox/packaging.md (revision 9093) +++ libopenmpt/dox/packaging.md (working copy) @@ -16,6 +16,8 @@ versions, however it can easily be processed to be compatible by replacing '-' (hyphen) with '~' (tilde). It is recommended that you use this exact transformation if required. + * Read \ref libopenmpt_c_staticlinking and thus possibly pass + `CXXSTDLIB_LIBS` variable to `configure` if appropriate and/or desired. * Use the autotools source package. * Use the default set of dependencies required by the autotools package. * Run the test suite in your build process. Index: libopenmpt/libopenmpt.h =================================================================== --- libopenmpt/libopenmpt.h (revision 9093) +++ libopenmpt/libopenmpt.h (working copy) @@ -111,6 +111,35 @@ * - Consecutive accesses can happen from different threads. * - Different objects can be accessed concurrently from different threads. * + * \section libopenmpt_c_staticlinking Statically linking to libopenmpt on Unix-like systems + * + * libopenmpt is implemented in C++. This imlies that linking to libopenmpt + * statically requires linking to the C++ runtime and standard library. The + * *highly* preferred and recommended way to do this is by using the C++ + * compiler instead of the platform linker to do the linking. This will do all + * necessary things that are C++ specific (in particular, it will pull in the + * appropriate runtime and/or library). If for whatever reason it is not + * possible to use the C++ compiler for linking, the libopenmpt build system can + * list the required libraries in the pkg-config file `libopenmpt.pc`. However, + * there is no reliable way to determine the name of the require library or + * libraries from within the build system. The libopenmpt autotools `configure` + * and plain `Makefile` honor the custom variable `CXXSTDLIB_LIBS` which serves + * the sole purpose of listing the standard library (or libraries) required for + * static linking. The contents of this variable will be put in `libopenmpt.pc` + * and used for nothing else. + * + * This problem is inherent to libraries implemented in C++ that can also be used + * without a C++ compiler. Other libraries try to solve that by listing + * `-lstdc++` unconditionally in `Libs.private`. However, that will break + * platforms that use a different C++ standard library (in particular FreeBSD). + * + * See https://lists.freedesktop.org/archives/pkg-config/2016-August/001055.html . + * + * Dymically linking to libopenmpt does not require anything special and will + * work as usual (and exactly as done for libraries implemented in C). + * + * This section does not apply to Windows systems. + * * \section libopenmpt_c_detailed Detailed documentation * * \ref libopenmpt_c |
|
The variable will most likely be called |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2017-10-17 07:51 | manx | New Issue | |
2017-10-17 07:51 | manx | Status | new => assigned |
2017-10-17 07:51 | manx | Assigned To | => manx |
2017-10-17 11:06 | manx | Note Added: 0003303 | |
2017-10-17 11:06 | manx | Description Updated | |
2017-10-17 11:50 | manx | File Added: static-v1.patch | |
2017-10-17 11:50 | manx | Note Added: 0003304 | |
2017-10-17 11:58 | manx | File Added: static-linking-v2.patch | |
2017-10-17 12:35 | manx | Additional Information Updated | |
2017-10-17 18:13 | manx | Product Version | => OpenMPT 1.26.14.00 / libopenmpt 0.2-beta27 (upgrade first) |
2017-10-17 18:13 | manx | Target Version | => OpenMPT 1.27.02.00 / libopenmpt 0.3.2/0.3.3 (upgrade first) |
2017-10-19 15:02 | manx | File Added: static-linking-v4.patch | |
2017-10-19 16:27 | manx | Note Added: 0003306 | |
2017-10-25 17:32 | manx | Additional Information Updated | |
2017-10-26 07:55 | manx | File Added: static-linking-v5.patch | |
2017-10-26 08:11 | manx | Status | assigned => resolved |
2017-10-26 08:11 | manx | Resolution | open => fixed |
2017-10-26 08:11 | manx | Fixed in Version | => OpenMPT 1.28.01.00 / libopenmpt 0.4.0 (upgrade first) |
2017-10-26 08:11 | manx | Note Added: 0003314 | |
2017-11-06 15:37 | Saga Musix | Fixed in Version | OpenMPT 1.28.01.00 / libopenmpt 0.4.0 (upgrade first) => OpenMPT 1.27.02.00 / libopenmpt 0.3.2/0.3.3 (upgrade first) |