From patchwork Tue Apr 23 23:22:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1089830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499575-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="LLorCtbx"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44pfcl3xWkz9s9y for ; Wed, 24 Apr 2019 09:22:47 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=hERHACk5h6a6VcI9gPT8G2RXD6+AN20+ynqd8DQ3CabMA4 hCrVP1N5z758fIPIHLuC3Ng7gQhxC8srHGomvHFkwVShrddSFEKBfC8b2rJxeORg ysBogr4AddswS6QQYspeh8juuoLLa3G3dp72v2gBKEXjJI85f29RtZTCEs9PA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=1YmAXNJaGvgEL1ilxDYtreZROms=; b=LLorCtbxketpikuiHJ0D 4KV1UGBTFD3HHYS07QX4zgLpHZRO5R5Ro6s2p9UKh09g/4bmLYmuRyjwc18bjavB JntdhNtBKm0Repf8aIP8Wf6n1lr1A9vAD+xHps1V3xi/3kPqLGDgCDtO2qc9GVeU 3syAaexb61mT29FmVGIFWqg= Received: (qmail 79399 invoked by alias); 23 Apr 2019 23:22:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 79389 invoked by uid 89); 23 Apr 2019 23:22:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=dragonflybsd, DragonFly, HX-Languages-Length:3979, dragonfly X-HELO: mail-qt1-f178.google.com Received: from mail-qt1-f178.google.com (HELO mail-qt1-f178.google.com) (209.85.160.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Apr 2019 23:22:38 +0000 Received: by mail-qt1-f178.google.com with SMTP id d13so18210883qth.5 for ; Tue, 23 Apr 2019 16:22:38 -0700 (PDT) MIME-Version: 1.0 From: Iain Buclaw Date: Wed, 24 Apr 2019 01:22:25 +0200 Message-ID: Subject: [PATCH, dragonfly] Add D language support for DragonFlyBSD x86 To: gcc-patches X-IsSubscribed: yes Hi, This patch adds necessary DragonFlyBSD support code, which allows libphobos to compile cleanly. OK for trunk? diff --git a/gcc/config.gcc b/gcc/config.gcc index 09fb9ecd2cd..14f0a1abbc8 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -724,6 +724,9 @@ case ${target} in extra_options="$extra_options rpath.opt dragonfly.opt" default_use_cxa_atexit=yes use_gcc_stdint=wrap + d_target_objs="${d_target_objs} dragonfly-d.o" + tmake_file="${tmake_file} t-dragonfly" + target_has_targetdm=yes ;; *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later diff --git a/gcc/config/dragonfly-d.c b/gcc/config/dragonfly-d.c new file mode 100644 index 00000000000..b8d4a9ff45d --- /dev/null +++ b/gcc/config/dragonfly-d.c @@ -0,0 +1,49 @@ +/* DragonFly support needed only by D front-end. + Copyright (C) 2019 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 +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm_d.h" +#include "d/d-target.h" +#include "d/d-target-def.h" + +/* Implement TARGET_D_OS_VERSIONS for DragonFly targets. */ + +static void +dragonfly_d_os_builtins (void) +{ + d_add_builtin_version ("DragonFlyBSD"); + d_add_builtin_version ("Posix"); +} + +/* Implement TARGET_D_CRITSEC_SIZE for DragonFly targets. */ + +static unsigned +dragonfly_d_critsec_size (void) +{ + /* This is the sizeof pthread_mutex_t, an opaque pointer. */ + return POINTER_SIZE_UNITS; +} + +#undef TARGET_D_OS_VERSIONS +#define TARGET_D_OS_VERSIONS dragonfly_d_os_builtins + +#undef TARGET_D_CRITSEC_SIZE +#define TARGET_D_CRITSEC_SIZE dragonfly_d_critsec_size + +struct gcc_targetdm targetdm = TARGETDM_INITIALIZER; diff --git a/gcc/config/t-dragonfly b/gcc/config/t-dragonfly new file mode 100644 index 00000000000..34fc389d965 --- /dev/null +++ b/gcc/config/t-dragonfly @@ -0,0 +1,21 @@ +# Copyright (C) 2019 Free Software Foundation, Inc. +# +# This file is part of GCC. +# +# 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 Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +dragonfly-d.o: $(srcdir)/config/dragonfly-d.c + $(COMPILE) $< + $(POSTCOMPILE) diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt index a53a3c3c3be..f9c881a8418 100644 --- a/libphobos/configure.tgt +++ b/libphobos/configure.tgt @@ -23,6 +23,9 @@ # broken systems. More targets shall be added after testing. LIBPHOBOS_SUPPORTED=no case "${target}" in + *-*-dragonfly*) + LIBPHOBOS_SUPPORTED=yes + ;; arm*-*-linux*) LIBPHOBOS_SUPPORTED=yes ;;