From owner-freebsd-current@freebsd.org Sun Aug 27 04:51:54 2017 Return-Path: Delivered-To: freebsd-current@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 60B3FDE74D2; Sun, 27 Aug 2017 04:51:54 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (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 36318653FC; Sun, 27 Aug 2017 04:51:54 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id r62so6687389pfj.0; Sat, 26 Aug 2017 21:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=V5IiacMvApYtqoP6AfNVrCyHRg+tv7rMabWHTy9F11k=; b=hY0f0zoZ/cMSCuMVtBYmULy7uRcM41we9MGvq0UrWSLMUURfeibREJhNv2HklosSu/ BUzNvPCIqprCegrF1rj43XFCI0aH1C/Y68sfIuGwv2j9ksehkQE7BU4WRN+DxRvX7AgY LFC1yHwC3mXChu3VOE3T1K7VixV6blr/B4g3p0sgHqKEfJvs8d9kaWavKWpZgnB9AF71 At85HMg5bM4VMZmB5UMgdtXl7PrrGSNtmOqATfSHEDwjAPeEx3xE+YHVK/o4P13RfE8y XflE1qbZVSeAxLE7SWkYJ7/e/JWajbQW6gzg2X8mzc27vI7RU25VGLm8Fvxd5TlsbTA5 pQ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=V5IiacMvApYtqoP6AfNVrCyHRg+tv7rMabWHTy9F11k=; b=K9XwzFH+GmsdapH/cCJywdQAc1S5iCYb7NHGFXs0NViKWYNfqA2gNajFSNK0TSho2C MMwXRO0PJTAss9Bsm7hV2Z83TWwJp9juygCav7HJsJHDd9tH6QTQzo0QpzxwvVr5se78 RYBCS0Kij2GjaREpxBmSwirjaVW+D1vcAqoL18X62IwZSmIYMLpdWR6vF4u3ynKS1JOs otGJk5ZGYP/iCPElTd3tdNlAj03ROV/mvfd690pvnQmHANjTa4IRuInB6S4S2j0kl0sX mgQzdRS69ZSV40HC9xgOdmhDrI/DHIIqZgYXoNHSVNUs4RoqQ78ZgwE/bZ1O7aCegEPJ 41eA== X-Gm-Message-State: AHYfb5jQMCJcxRoG+SoBopNlrHd7N9x2PWy/V+GDmwSvnC3InutbZO20 lttqW5Q1xHMV3HlE2z8YFER7sr2rFA== X-Received: by 10.84.232.10 with SMTP id h10mr3778390plk.261.1503809513373; Sat, 26 Aug 2017 21:51:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.207.193 with HTTP; Sat, 26 Aug 2017 21:51:52 -0700 (PDT) In-Reply-To: References: From: Ryan Libby Date: Sat, 26 Aug 2017 21:51:52 -0700 Message-ID: Subject: Re: Compiling the kernel using GCC To: Aijaz Baig Cc: FreeBSD Hackers , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Aug 2017 04:51:54 -0000 On Sat, Aug 26, 2017 at 2:41 AM, Aijaz Baig wrote: > Has anyone been able to successfully compile the kernel using GCC as > against CLANG the default compiler on most later versions of FreeBSD? I was > able to successfully buildworld. After which I reboot and now /usr/bin/cc > points to GCC as requested. However kernel fails to link [...] > make -D KERNFAST -m /usr/src/share/mk KERNEL=kernel all -DNO_MODULES_OBJ > linking kernel.full > ck_array.o: In function `ck_cc_popcount': > /usr/src/sys/contrib/ck/include/gcc/ck_cc.h:139: undefined reference to > `__popcountdi2' [...] Do you need ck? Can you share your KERNCONF? And the branch and revision you are building? I have been building an amd64 GENERIC kernel on head with various gccs. I think that does not build ck. The main method I have been focusing on for now is make CROSS_TOOLCHAIN=amd64-gcc TARGET=amd64 TARGET_ARCH=amd64 buildkernel with the amd64-xtoolchain-gcc-0.2 package installed. But I have also built kernel-only successfully with gcc 6 with src.conf e.g. as below. % cat /etc/src.conf.gcc6 WITH_GCC=yes WITH_GCC_BOOTSTRAP=yes WITH_GCC_IS_CC=yes WITHOUT_CLANG=yes WITHOUT_CLANG_BOOTSTRAP=yes WITHOUT_CLANG_IS_CC=yes WITHOUT_FORMAT_EXTENSIONS=yes CC=/usr/local/bin/gcc6 CXX=/usr/local/bin/g++6