From owner-freebsd-arm@freebsd.org Mon Oct 23 19:27:02 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 107C9E532CD for ; Mon, 23 Oct 2017 19:27:02 +0000 (UTC) (envelope-from eddy.petrisor@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AD04812AD for ; Mon, 23 Oct 2017 19:27:01 +0000 (UTC) (envelope-from eddy.petrisor@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id m72so11567509wmc.1 for ; Mon, 23 Oct 2017 12:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=G6l8Rr/X3iW0QZhYw33BjhRAkrvNPlUM0VC0r8Txd8U=; b=O+xazToUU75BBuJnIntfdJ9CY9tvq52krv4pJyMTzMvpDMPmXtfBIEE6vaHrWDfhn6 oKB5s0agLh756GI8Zo1l0G47lOEZ/JStIp3CllU5X2PPF+LD9xiLjFsPQyYEH2m7Vrhh Fuf3oJMIl4ifHGJgE9SZttuPRVfZdLUU1XDUq7IFPPiC5hG/TArEKAJhQeQ43yq7nhlN EFluoiU+PUK+7joOi7046SzUNobJwoQO8eTL7a3BH6O9NSOt0n4UqxHGUZttauNFw94R SL8YGGvZvbWiDQBzgMIUKaLrtzC/J3DOFjAuD6MxVELSOPzrmU0M6xwhUNpsPjeXxL46 yVEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=G6l8Rr/X3iW0QZhYw33BjhRAkrvNPlUM0VC0r8Txd8U=; b=Z4zHmqWLqliDNi/fKK9u0UMDuzYk+7vjo9KMvFpmdpGoX6EpnEoPTp5HS90G18lqLh YTgqB3yHDWc32O2BCeDGPG8gK2H+1YPPxRLC2ZBoj+/jtJhdzDj7ixFCffngkYC1mpfC kx9Tw8zW8gZSWm7TkmiTFZi5okxZPoqvk93+hnq4D5D2n2uLW4bL4fj+xk4mN0HUuCW0 ve3ESHg5zNM+nxIHoO6tMcMe9bxyCtpT7p7NPgI+t05sVMWDmw7n+aAg+3j0Hfpchabh 8FzuTLeQDuJIUi3To82vq/RZHDsfrHGU43T/b4s6Oxd8m4czIkDXwKVzPOhUnjmcze21 490w== X-Gm-Message-State: AMCzsaXk8YChp1+5gs8jThaKizWML6zdY65DhuqRLbXrV7owc9QYbffe yJoKKb4H/lAu7XqhMliah1sFuGw/4m1CVi2uWKpG6+Pd X-Google-Smtp-Source: ABhQp+RigjCZZInPnar13OCV3tte7khNCvM8d/nP2EOzmTIhDdLHXKWeqFsiU5oSFmxrXxY7e3p5po9yDKUeUQqQeGA= X-Received: by 10.28.231.25 with SMTP id e25mr4660760wmh.157.1508786819699; Mon, 23 Oct 2017 12:26:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.173.129 with HTTP; Mon, 23 Oct 2017 12:26:59 -0700 (PDT) From: =?UTF-8?Q?Eddy_Petri=C8=99or?= Date: Mon, 23 Oct 2017 22:26:59 +0300 Message-ID: Subject: How does (src)/sys/x86/machine/endian.h get deplyoed as DESTDIR/usr/include/x86/endian.h To: freebsd-arm@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 19:27:02 -0000 Hello, I am trying to add cross build support of FreeBSD from a Linux build system and I am taking it one small step at a time. I have a wrapper script to consistently set environment variables, to set the correct bmake and the proper MAKEFLAGS to pass the correct dirs for the .mk files and made some changes to map the uname -p/uname -m's reported x86_64 to amd64 for the MACHINE* variables. During 'make TARGET=3Damd64 toolchain' the compilation of contrib/libc-pwcache/pwcache.c fails to find some definitions. Of course, before implementing the changes in the build system (or my Linux wrapper script) definitons that might make sense for a build from Linux, I am trying to compile by hand the offending pwcache.c file, and, although some of them I was able to resolve either by using the files from freebsd-glue or by adding -Isys, I am a little puzzled by the mix of build and freebsd headers/definitions and also got stuck because in my mind the compilation at this stage needs to generate binaries for running on a linux system, but some definitions seem to be freebsd specfic. In either case, I saw that on the FreeBSD system I am using as a reference there are some files (such as endian.h) are in /usr/include/x86, but in the source tree they were in the source tree in sys/x86/machine. Since at this stage it looks like I need some kind of way to do an install-headers(?) from sys/$MACHINE/machine (+x86, in case of x86_64) to a $NON_BSD_WRAPPERSDIR/$MACHINE/usr/include directory: 1) does it make sense to try to use the headers from src, or is the right way (tm) to add definitions which are 100% correct for Linux? 1.1) I am thinking that since the definitions were originally in the src tree under sys, they are related to the FreeBSD kernel, so it makes little sense to try to define something for Linux. Am I wrong? Does it make sense to continue on this route? 2) is there such a target/script that I can run to populate my wrappers dir with the right headers no matter which $MACHINE we're talking about? --=20 Eddy Petri=C8=99or