From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1873) id 7A7E1386197F; Sat, 10 Apr 2021 15:04:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A7E1386197F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain Buclaw To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/ibuclaw/heads/darwin)] libphobos: Checkpoint in darwin runtime support X-Act-Checkin: gcc X-Git-Author: Iain Buclaw X-Git-Refname: refs/users/ibuclaw/heads/darwin X-Git-Oldrev: e6ff924b9f16bdb53fdfabdb0ab3b41fcab52e48 X-Git-Newrev: fb65d306947685b2492f7ba6622936575d638842 Message-Id: <20210410150404.7A7E1386197F@sourceware.org> Date: Sat, 10 Apr 2021 15:04:04 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Apr 2021 15:04:04 -0000 https://gcc.gnu.org/g:fb65d306947685b2492f7ba6622936575d638842 commit fb65d306947685b2492f7ba6622936575d638842 Author: Iain Buclaw Date: Sun Nov 29 14:44:28 2020 +0100 libphobos: Checkpoint in darwin runtime support Diff: --- libphobos/configure | 22 ++++++++++++++++++---- libphobos/libdruntime/config/x86/switchcontext.S | 8 ++++++++ libphobos/libdruntime/gcc/deh.d | 5 ----- libphobos/libdruntime/gcc/sections/common.d | 2 +- libphobos/m4/druntime/os.m4 | 22 ++++++++++++++++++---- libphobos/testsuite/lib/libphobos.exp | 4 ++++ 6 files changed, 49 insertions(+), 14 deletions(-) diff --git a/libphobos/configure b/libphobos/configure index fe7cd9c11ff..bbdcb409562 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -14422,6 +14422,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -14430,17 +14432,29 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for minfo section bracketing" >&5 $as_echo_n "checking for minfo section bracketing... " >&6; } + case "$druntime_cv_target_os" in + darwin*) + section="__DATA,__minfodata" + start="section\$start\$__DATA\$__minfodata" + stop="section\$end\$__DATA\$__minfodata" + ;; + *) + section="minfo" + start="__start_minfo" + stop="__stop_minfo" + ;; + esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - void* module_info_ptr __attribute__((section ("minfo"))); - extern void* __start_minfo __attribute__((visibility ("hidden"))); - extern void* __stop_minfo __attribute__((visibility ("hidden"))); + void* module_info_ptr __attribute__((section ("$section"))); + extern void* start_minfo __asm__("$start") __attribute__((visibility ("hidden"))); + extern void* stop_minfo __asm__("$stop") __attribute__((visibility ("hidden"))); int main() { // Never run, just to prevent compiler from optimizing access - return &__start_minfo == &__stop_minfo; + return (int)(&stop_minfo - &start_minfo); } _ACEOF diff --git a/libphobos/libdruntime/config/x86/switchcontext.S b/libphobos/libdruntime/config/x86/switchcontext.S index 82420c6159c..8af3f5488ba 100644 --- a/libphobos/libdruntime/config/x86/switchcontext.S +++ b/libphobos/libdruntime/config/x86/switchcontext.S @@ -33,7 +33,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .text .globl CSYM(fiber_switchContext) +#if defined(__ELF__) .type CSYM(fiber_switchContext), @function +#endif .align 16 CSYM(fiber_switchContext): .cfi_startproc @@ -61,13 +63,17 @@ CSYM(fiber_switchContext): // 'return' to complete switch ret .cfi_endproc +#if defined(__ELF__) .size CSYM(fiber_switchContext),.-CSYM(fiber_switchContext) +#endif #elif defined(__x86_64__) && !defined(__ILP32__) && !defined(__CET__) .text .globl CSYM(fiber_switchContext) +#if defined(__ELF__) .type CSYM(fiber_switchContext), @function +#endif .align 16 CSYM(fiber_switchContext): .cfi_startproc @@ -96,6 +102,8 @@ CSYM(fiber_switchContext): // 'return' to complete switch ret .cfi_endproc +#if defined(__ELF__) .size CSYM(fiber_switchContext),.-CSYM(fiber_switchContext) +#endif #endif diff --git a/libphobos/libdruntime/gcc/deh.d b/libphobos/libdruntime/gcc/deh.d index 2e679320c38..8df5ac63d81 100644 --- a/libphobos/libdruntime/gcc/deh.d +++ b/libphobos/libdruntime/gcc/deh.d @@ -34,11 +34,6 @@ extern(C) { int _d_isbaseof(ClassInfo, ClassInfo); void _d_createTrace(Object, void*); - - // Not used in GDC but declaration required by rt/sections.d - struct FuncTable - { - } } /** diff --git a/libphobos/libdruntime/gcc/sections/common.d b/libphobos/libdruntime/gcc/sections/common.d index 85fdc0efd48..411f58ac548 100644 --- a/libphobos/libdruntime/gcc/sections/common.d +++ b/libphobos/libdruntime/gcc/sections/common.d @@ -1,5 +1,5 @@ // Contains various utility functions used by the runtime implementation. -// Copyright (C) 2019-2021 Free Software Foundation, Inc. +// Copyright (C) 2021 Free Software Foundation, Inc. // GCC is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4 index ed93e30f1e9..351558dbcda 100644 --- a/libphobos/m4/druntime/os.m4 +++ b/libphobos/m4/druntime/os.m4 @@ -149,17 +149,31 @@ AC_DEFUN([DRUNTIME_OS_ARM_EABI_UNWINDER], # substitute DCFG_MINFO_BRACKETING. AC_DEFUN([DRUNTIME_OS_MINFO_BRACKETING], [ + AC_REQUIRE([DRUNTIME_OS_DETECT]) + AC_LANG_PUSH([C]) AC_MSG_CHECKING([for minfo section bracketing]) + case "$druntime_cv_target_os" in + darwin*) + section="__DATA,__minfodata" + start="section\$start\$__DATA\$__minfodata" + stop="section\$end\$__DATA\$__minfodata" + ;; + *) + section="minfo" + start="__start_minfo" + stop="__stop_minfo" + ;; + esac AC_LINK_IFELSE([AC_LANG_SOURCE([ - void* module_info_ptr __attribute__((section ("minfo"))); - extern void* __start_minfo __attribute__((visibility ("hidden"))); - extern void* __stop_minfo __attribute__((visibility ("hidden"))); + void* module_info_ptr __attribute__((section ("$section"))); + extern void* start_minfo __asm__("$start") __attribute__((visibility ("hidden"))); + extern void* stop_minfo __asm__("$stop") __attribute__((visibility ("hidden"))); int main() { // Never run, just to prevent compiler from optimizing access - return &__start_minfo == &__stop_minfo; + return (int)(&stop_minfo - &start_minfo); } ])], [AC_MSG_RESULT([yes]) diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp index 3be2092b12e..ad323d761b9 100644 --- a/libphobos/testsuite/lib/libphobos.exp +++ b/libphobos/testsuite/lib/libphobos.exp @@ -90,6 +90,10 @@ proc libphobos-dg-test { prog do_what extra_tool_flags } { } proc libphobos-dg-prune { system text } { + + # Ignore warnings from cctools. + regsub -all "(^|\n)clang: warning: argument unused during compilation:\[^\n\]*" $text "" text + return $text }