From owner-dev-commits-src-all@freebsd.org Thu Aug 5 09:25:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9B90660703; Thu, 5 Aug 2021 09:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GgNWk4187z4nNG; Thu, 5 Aug 2021 09:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53B3617CB2; Thu, 5 Aug 2021 09:25:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1759PsvN006762; Thu, 5 Aug 2021 09:25:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1759Ps4T006761; Thu, 5 Aug 2021 09:25:54 GMT (envelope-from git) Date: Thu, 5 Aug 2021 09:25:54 GMT Message-Id: <202108050925.1759Ps4T006761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: 85c76b41178c - stable/13 - tools/build: Don't redefine open() for the linux bootstrap MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 85c76b41178c69ad8262523bc19fe53d69110d92 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 09:25:54 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=85c76b41178c69ad8262523bc19fe53d69110d92 commit 85c76b41178c69ad8262523bc19fe53d69110d92 Author: Alex Richardson AuthorDate: 2021-08-02 08:45:05 +0000 Commit: Alex Richardson CommitDate: 2021-08-05 09:00:45 +0000 tools/build: Don't redefine open() for the linux bootstrap This is needed to bootstrap llvm-tblgen on Linux since LLVM calls `::open(...)` which does not work if open is a statement macro. Also stop defining O_SHLOCK/O_EXLOCK and update the only bootstrap tools user of those flags to deal with missing definitions. Reviewed By: jrtc27 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31226 (cherry picked from commit 5f6c8ce2452da2da233e37bf4c2b6fccde8594b1) --- lib/libc/db/db/db.c | 6 ++++++ tools/build/cross-build/include/linux/fcntl.h | 25 ++++--------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/lib/libc/db/db/db.c b/lib/libc/db/db/db.c index a9a5b060da62..7158cc80e44e 100644 --- a/lib/libc/db/db/db.c +++ b/lib/libc/db/db/db.c @@ -49,6 +49,12 @@ static int __dberr(void); #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif +#ifndef O_EXLOCK +#define O_EXLOCK 0 +#endif +#ifndef O_SHLOCK +#define O_SHLOCK 0 +#endif DB * dbopen(const char *fname, int flags, int mode, DBTYPE type, const void *openinfo) diff --git a/tools/build/cross-build/include/linux/fcntl.h b/tools/build/cross-build/include/linux/fcntl.h index 94662befddad..4fa169d4ed4c 100644 --- a/tools/build/cross-build/include/linux/fcntl.h +++ b/tools/build/cross-build/include/linux/fcntl.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright 2018-2020 Alex Richardson + * Copyright 2018-2021 Alex Richardson * * This software was developed by SRI International and the University of * Cambridge Computer Laboratory (Department of Computer Science and @@ -12,6 +12,9 @@ * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) * ("CTSRD"), as part of the DARPA CRASH research programme. * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -37,29 +40,9 @@ */ #pragma once - /* includes which contains a member __unused */ #include "__unused_workaround_start.h" #include_next #include "__unused_workaround_end.h" -#ifdef __unused_undefd -#undef __unused_undefd -#define __unused __attribute__((unused)) -#endif - #include - -#ifndef O_EXLOCK -#define O_EXLOCK (1 << 30) -#endif -#ifndef O_SHLOCK -#define O_SHLOCK (1 << 31) -#endif - -#undef open -#define open(path, flags, ...) ({ \ - int __fd = (open)(path, flags, ##__VA_ARGS__); \ - if (flags & O_EXLOCK) flock(__fd, LOCK_EX); \ - if (flags & O_SHLOCK) flock(__fd, LOCK_SH); \ - __fd; })