From fdb53355e47398aad620b308ec1a5c0807e66a67 Mon Sep 17 00:00:00 2001 From: Peter Jas Date: Sat, 25 Jun 2016 01:01:11 +0300 Subject: [PATCH] Use libc.so as default libc name (dotnet/coreclr#5990) Based on https://github.com/dotnet/coreclr/pull/5727#discussion_r68369439, it turned out `/lib/libc.musl-x86_64.so.1` was just a symlink in Alpine Linux to actual lib `/lib/ld-musl-x86_64.so.1`. This delta makes libc.so as default name for libc and removes all the detection for musl and FreeBSD from cmake etc. Commit migrated from https://github.com/dotnet/coreclr/commit/66f12f84f1d7a764adf715591fe3283f20f034d8 --- src/coreclr/src/pal/src/config.h.in | 2 -- src/coreclr/src/pal/src/configure.cmake | 12 ------------ src/coreclr/src/pal/src/loader/module.cpp | 8 ++------ 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/coreclr/src/pal/src/config.h.in b/src/coreclr/src/pal/src/config.h.in index 73a79b8..c3bf974 100644 --- a/src/coreclr/src/pal/src/config.h.in +++ b/src/coreclr/src/pal/src/config.h.in @@ -136,8 +136,6 @@ #cmakedefine01 UNWIND_CONTEXT_IS_UCONTEXT_T #cmakedefine01 HAVE_FULLY_FEATURED_PTHREAD_MUTEXES #cmakedefine BSD_REGS_STYLE(reg, RR, rr) @BSD_REGS_STYLE@ -#cmakedefine FREEBSD_LIBC "@FREEBSD_LIBC@" -#cmakedefine MUSL_LIBC_SO "@MUSL_LIBC_SO@" #cmakedefine01 HAVE_SCHED_OTHER_ASSIGNABLE #define CHECK_TRACE_SPECIFIERS 0 diff --git a/src/coreclr/src/pal/src/configure.cmake b/src/coreclr/src/pal/src/configure.cmake index 7e95a77..b4e7489 100644 --- a/src/coreclr/src/pal/src/configure.cmake +++ b/src/coreclr/src/pal/src/configure.cmake @@ -1059,13 +1059,6 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) set(HAS_FTRUNCATE_LENGTH_ISSUE 0) set(BSD_REGS_STYLE "((reg).r_##rr)") set(HAVE_SCHED_OTHER_ASSIGNABLE 1) - - if(EXISTS "/lib/libc.so.7") - set(FREEBSD_LIBC "/lib/libc.so.7") - else() - message(FATAL_ERROR "Cannot find libc on this system.") - endif() - elseif(CMAKE_SYSTEM_NAME STREQUAL NetBSD) if(NOT HAVE_LIBUNWIND_H) unset(HAVE_LIBUNWIND_H CACHE) @@ -1114,11 +1107,6 @@ else() # Anything else is Linux unset(HAVE_LIBUUID_H CACHE) message(FATAL_ERROR "Cannot find libuuid. Try installing uuid-dev or the appropriate packages for your platform") endif() - if(NOT HAVE_GNU_LIBNAMES_H) - if(EXISTS /lib/libc.musl-x86_64.so.1) - set(MUSL_LIBC_SO "/lib/libc.musl-x86_64.so.1") - endif() - endif() set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0) set(PAL_PTRACE "ptrace((cmd), (pid), (void*)(addr), (data))") set(PAL_PT_ATTACH PTRACE_ATTACH) diff --git a/src/coreclr/src/pal/src/loader/module.cpp b/src/coreclr/src/pal/src/loader/module.cpp index 006d1bf..1c06371 100644 --- a/src/coreclr/src/pal/src/loader/module.cpp +++ b/src/coreclr/src/pal/src/loader/module.cpp @@ -1617,15 +1617,11 @@ static HMODULE LOADLoadLibrary(LPCSTR shortAsciiName, BOOL fDynamic) #if defined(__APPLE__) shortAsciiName = "libc.dylib"; #elif defined(__FreeBSD__) - shortAsciiName = FREEBSD_LIBC; -#elif defined(__NetBSD__) - shortAsciiName = "libc.so"; + shortAsciiName = "libc.so.7"; #elif defined(LIBC_SO) shortAsciiName = LIBC_SO; -#elif defined(MUSL_LIBC_SO) - shortAsciiName = MUSL_LIBC_SO; #else -#error Don't know how to get libc name on this platform + shortAsciiName = "libc.so"; #endif } -- 2.7.4