Backed out 3 changesets (bug 1883720, bug 1883719, bug 1883615) for causing multiple failures. CLOSED TREE

Backed out changeset 495b9e84ba9d (bug 1883720)
Backed out changeset 5a89cbc54dd2 (bug 1883615)
Backed out changeset 9d075e352b0e (bug 1883719)
This commit is contained in:
Tamas Szentpeteri 2024-05-15 13:30:17 +03:00
parent bfedcb8a24
commit 22c92af506
22 changed files with 65 additions and 134 deletions

View File

@ -149,9 +149,7 @@ def check_symbol_flags(linker_ldflags, kernel):
# a test program. The return value of the template is a check function
# returning True if the symbol can be found, and None if it is not.
@template
def check_symbol(
symbol, language="C", flags=None, msg_extra="", when=None, onerror=lambda: None
):
def check_symbol(symbol, language="C", flags=None, when=None, onerror=lambda: None):
if when is None:
when = always
@ -185,64 +183,12 @@ def check_symbol(
header=comment + ["%schar %s();" % (extern_c, symbol)],
body="%s();" % symbol,
flags=flags,
check_msg="for %s%s" % (symbol, msg_extra),
check_msg="for %s" % symbol,
when=when,
onerror=onerror,
)
# Checks for the presence of the given symbol in the given library on the
# target system by compiling a test program. The return value of the template
# is a check function returning True if the symbol can be found, and None if it
# is not.
@template
def check_symbol_in_lib(libname, symbol, language="C", when=None, onerror=lambda: None):
flag = f"-l{libname}"
have_symbol = check_symbol(
symbol,
flags=[flag],
msg_extra=f" in {flag}",
language=language,
when=when,
onerror=onerror,
)
return have_symbol
# Same as check_symbol_in_lib but iteratively try libraries in the given libnames until it
# finds one that contains the given symbol.
# Returns None if not found, empty tuple if None is in the given libnames and
# the symbol is present without library linked, a singleton containing the
# library name if found in that library.
@template
def check_symbol_in_libs(
libnames, symbol, language="C", when=None, onerror=lambda: None
):
have_symbol = never
found_lib = dependable(namespace(found=False, lib=None))
kwargs = {
"symbol": symbol,
"language": language,
"when": when or always,
"onerror": onerror,
}
for libname in libnames:
kwargs["when"] &= ~have_symbol
if libname:
have_symbol = check_symbol_in_lib(libname, **kwargs)
else:
have_symbol = check_symbol(**kwargs)
add_lib = namespace(found=True, lib=libname)
found_lib = depends(have_symbol, found_lib)(lambda h, f: add_lib if h else f)
return found_lib
# Determine whether to add a given flag to the given lists of flags for C or
# C++ compilation.
# - `flag` is the flag to test

View File

@ -53,33 +53,3 @@ have_res_ninit = try_link(
)
set_define("HAVE_RES_NINIT", have_res_ninit)
# We don't want to link with libdl even if it's present on OS X, since
# it's not used and not part of the default installation.
# We don't want to link against libm or libpthread on Darwin since
# they both are just symlinks to libSystem and explicitly linking
# against libSystem causes issues when debugging (see bug 299601).
with only_when(building_with_gnu_cc & ~target_is_darwin):
check_header("dlfcn.h")
dlopen_check = check_symbol_in_libs(["dl", None], symbol="dlopen")
dladdr_check = check_symbol_in_libs(["dl", None], symbol="dladdr")
set_config("DL_LIBS", ["-ldl"], when=depends(dlopen_check)(lambda check: check.lib))
set_define(
"HAVE_DLADDR", depends(dladdr_check)(lambda check: "1" if check.found else "0")
)
set_config(
"C_R_LIBS",
["-lc_r"],
when=check_symbol_in_lib(
"c_r", symbol="gethostbyname_r", when=building_with_gnu_cc
),
)
set_config(
"SOCKET_LIBS",
["-lsocket"],
when=check_symbol_in_lib("socket", symbol="socket", when=building_with_gnu_cc),
)

View File

@ -13,14 +13,6 @@ else:
# TODO: fix NSPR warnings and remove this
AllowCompilerWarnings()
OS_LIBS += CONFIG["DL_LIBS"]
# for gethostbyname_r
OS_LIBS += CONFIG["C_R_LIBS"]
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
DEFINES["_NSPR_BUILD_"] = True
if CONFIG["OS_ARCH"] == "Linux":
OS_LIBS += CONFIG["REALTIME_LIBS"]

View File

@ -6,9 +6,6 @@
include("/ipc/chromium/chromium-config.mozbuild")
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
if CONFIG["OS_TARGET"] != "WINNT":
SOURCES += [
"buffered_stun_socket_unittest.cpp",

View File

@ -13,12 +13,6 @@ if CONFIG["TARGET_KERNEL"] == "WINNT":
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
error('should not reach here if we are using a native libevent')
# for gethostbyname_r
OS_LIBS += CONFIG["C_R_LIBS"]
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
UNIFIED_SOURCES += [
'libevent/buffer.c',
'libevent/bufferevent.c',

View File

@ -442,6 +442,36 @@ AC_LANG_CPLUSPLUS
MOZ_CXX11
dnl Checks for libraries.
dnl ========================================================
AC_CHECK_LIB(c_r, gethostbyname_r)
dnl We don't want to link with libdl even if it's present on OS X, since
dnl it's not used and not part of the default installation. OS/2 has dlfcn
dnl in libc.
dnl We don't want to link against libm or libpthread on Darwin since
dnl they both are just symlinks to libSystem and explicitly linking
dnl against libSystem causes issues when debugging (see bug 299601).
case $target in
*-darwin*)
;;
*)
AC_SEARCH_LIBS(dlopen, dl,
MOZ_CHECK_HEADER(dlfcn.h,
AC_DEFINE(HAVE_DLOPEN)))
;;
esac
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_GNU_SOURCE"
AC_CHECK_FUNCS(dladdr)
CFLAGS="$_SAVE_CFLAGS"
if test ! "$GNU_CXX"; then
AC_CHECK_LIB(C, demangle)
fi
AC_CHECK_LIB(socket, socket)
dnl ========================================================
dnl = pthread support

View File

@ -8,6 +8,4 @@ SOURCES += [
"mozva.c",
]
OS_LIBS += CONFIG["DL_LIBS"]
Library("mozva")

View File

@ -5524,7 +5524,7 @@ static void replace_malloc_init_funcs(malloc_table_t* table) {
#include "malloc_decls.h"
// ***************************************************************************
#ifdef HAVE_DLFCN_H
#ifdef HAVE_DLOPEN
# include <dlfcn.h>
#endif

View File

@ -82,8 +82,6 @@ DEFINES["IMPL_MFBT"] = True
if CONFIG["MOZ_NEEDS_LIBATOMIC"]:
OS_LIBS += ["atomic"]
OS_LIBS += CONFIG["DL_LIBS"]
DisableStlWrapping()
include("/mozglue/build/replace_malloc.mozbuild")

View File

@ -22,6 +22,4 @@ if CONFIG["MOZ_LINKER"]:
"/mozglue/linker",
]
OS_LIBS += CONFIG["DL_LIBS"]
FINAL_LIBRARY = "mozglue"

View File

@ -33,7 +33,7 @@ using namespace mozilla;
# define _GNU_SOURCE
#endif
#if defined(HAVE_DLFCN_H) || defined(XP_DARWIN)
#if defined(HAVE_DLOPEN) || defined(XP_DARWIN)
# include <dlfcn.h>
#endif

View File

@ -8,9 +8,6 @@ EXPORTS.mozilla.net += [
'usrsctp.h',
]
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
UNIFIED_SOURCES += [
'netinet/sctp_asconf.c',
'netinet/sctp_auth.c',

View File

@ -41,9 +41,6 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
]
UNIFIED_SOURCES += ["nsNamedPipeIOLayer.cpp", "nsNamedPipeService.cpp"]
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
FINAL_LIBRARY = "xul"
CONFIGURE_SUBST_FILES += ["neqo/extra-bindgen-flags"]

View File

@ -9,7 +9,4 @@ if CONFIG["OS_ARCH"] == "Linux":
"NetlinkService.cpp",
]
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
FINAL_LIBRARY = "xul"

View File

@ -12,9 +12,6 @@ XPIDL_SOURCES += [
XPIDL_MODULE = "necko_wifi"
# for socket
OS_LIBS += CONFIG["SOCKET_LIBS"]
UNIFIED_SOURCES += [
"nsWifiAccessPoint.cpp",
"nsWifiMonitor.cpp",

View File

@ -459,6 +459,36 @@ MOZ_CXX11
AC_LANG_C
dnl Checks for libraries.
dnl ========================================================
AC_CHECK_LIB(c_r, gethostbyname_r)
dnl We don't want to link with libdl even if it's present on OS X, since
dnl it's not used and not part of the default installation. OS/2 has dlfcn
dnl in libc.
dnl We don't want to link against libm or libpthread on Darwin since
dnl they both are just symlinks to libSystem and explicitly linking
dnl against libSystem causes issues when debugging (see bug 299601).
case $target in
*-darwin*)
;;
*)
AC_SEARCH_LIBS(dlopen, dl,
MOZ_CHECK_HEADER(dlfcn.h,
AC_DEFINE(HAVE_DLOPEN)))
;;
esac
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -D_GNU_SOURCE"
AC_CHECK_FUNCS(dladdr)
CFLAGS="$_SAVE_CFLAGS"
if test ! "$GNU_CXX"; then
AC_CHECK_LIB(C, demangle)
fi
AC_CHECK_LIB(socket, socket)
dnl ========================================================
dnl = pthread support

View File

@ -6,6 +6,4 @@
DIRS += ["dynamic-library"]
OS_LIBS += CONFIG["DL_LIBS"]
RustLibrary("builtins-static")

View File

@ -19,8 +19,6 @@ else:
"stub.c",
]
OS_LIBS += CONFIG["DL_LIBS"]
if CONFIG["OS_TARGET"] == "Android":
OS_LIBS += ["m"]

View File

@ -18,8 +18,6 @@ USE_LIBS += [
"nspr",
]
OS_LIBS += CONFIG["DL_LIBS"]
EXPORTS.mozilla += [
"Sandbox.h",
"SandboxInfo.h",

View File

@ -27,8 +27,6 @@ SOURCES += [
'sqlite3.c',
]
OS_LIBS += CONFIG["DL_LIBS"]
# -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
# don't have to vacuum to make sure the data is not visible in the file.
# -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768

View File

@ -22,7 +22,5 @@ CXXFLAGS += CONFIG["MOZ_PANGO_CFLAGS"]
OS_LIBS += CONFIG["MOZ_X11_LIBS"]
OS_LIBS += CONFIG["MOZ_GTK3_LIBS"]
OS_LIBS += CONFIG["DL_LIBS"]
NO_PGO = True
DisableStlWrapping()

View File

@ -50,7 +50,7 @@
#include <string>
#include <vector>
#ifdef HAVE_DLFCN_H
#ifdef HAVE_DLOPEN
# include <dlfcn.h>
#endif