From owner-freebsd-current@freebsd.org Sat Jul 21 19:11:26 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B731029A73 for ; Sat, 21 Jul 2018 19:11:26 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10097744DD; Sat, 21 Jul 2018 19:11:25 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 62B3920F20; Sat, 21 Jul 2018 15:11:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 21 Jul 2018 15:11:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=r1vRv5d0Hx9TS6t8bm3pI+g4UvWyG gBAIWxGpd4iSEw=; b=IRPrz/bL88cfmkobqKEx7RlTywo3HtFAtycmCZx5szX0X R5P23Ybm8VKtzOaXAGTU+isae0WLhZ0WoFpWFf/Y3SAwK8rhrIwgIYLhP4jf5IoV Moz41PDPEzYDva8R9usTk6lPMNoxq/7frqoxx9WigkONFJZLTjkc5D8wmFO3tcZt LJ3nqiphLJ8N+22O78cjE/+6+vTH9daXW6x7WY7TKBFIpAWWutQv8Ap25d1RSe+q DuChfKya9W+iSGt3i7+NElguBp0wwr+fRmEf1zPqXrkeD3SxjUxLwq9gM+jvo7ZO qpypQCa30ENVaFgq9ytvaWfMawozCmA4mlStz5s3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=r1vRv5 d0Hx9TS6t8bm3pI+g4UvWyGgBAIWxGpd4iSEw=; b=foVnd4yud2e20GvdLlsTAZ Nn1AzgbqKDlDIo2LFdjeSyTWRQ5R8I7fC+6W/Kr9pwWjh8lc7djcIa7F2s+vnXQG zftPUD/Rw6znaP/Y/0ysup8Vk25L0PAkhUgliZPK8pptkpUFDwthN4hCMiwIcBhy SeWxE7C9GbO5npepzmmbTE/iYB/dVgeFOz7oD3QwB5qRC9DjOS1bwRedF9PyZCmk gwcDaKOoZXOYbl2CQjn1jOuMWVVSj6LqZ5CAfA6kJ6RcjKnJ1LX1HROJ1k7ZhLT5 vvGJBqigqQYpZl74ytX2/5qUxxtFHRvoy1S+pXyAv4jeqJYgcdRThw/kDEO0Q7qQ == X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.2] (unknown [62.183.124.233]) by mail.messagingengine.com (Postfix) with ESMTPA id 9E8D110268; Sat, 21 Jul 2018 15:11:23 -0400 (EDT) Subject: Re: gcc/clang interoperability problem with a custom "samba" build in recent -current. From: Yuri Pankov To: Julian Elischer , freebsd-current References: Message-ID: <3dd60a0d-7a5e-e9f0-3018-d09b5b8ac389@yuripv.net> Date: Sat, 21 Jul 2018 22:11:19 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 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: Sat, 21 Jul 2018 19:11:26 -0000 Yuri Pankov wrote: > Julian Elischer wrote: >> I would really like ot get some pointers as to who are our tools >> committers at the moment, in particular who might know about these issues. >> The main issue for me at the moment is the ability to compile the >> aesni code in Samba from clang.. >> >> Julian >> >> >> On 20/7/18 7:32 pm, Julian Elischer wrote: >>> compiling our samba with gcc 4.2.1 in 12 gave us some off behaviour >>> when lld became the linker I think.. >>> >>> 1/ linking needed some directories added to some of the build >>> scripts because previously apparently it looked in $SYSROOT/usr/lib >>> by default and now it doesn't. >>> >>> 2/ compiling our samba produces a libtdb.so that has various symbols >>> in it, (according to nm(1) ), but when we try link against it we get >>> complaints about those symbols not being defined. >>> >>> 3/ an attempt to switch to using clang to compile everything leads to: >>> >>> >>> "--aes-accel=intelaesni selected and compiler rejects -Wp,-E,-lang-asm. >>> >>> One wonders whether there is a clang equivalent of "-Wp,-E,-lang-asm" >>> >>> The AES acceleration is a configure option for the samba package. >>> >>> Apparently turning it on requires -Wp,-E,-lang-asm. >>> >>> which apparently gcc 4.2.1 has, but clang doesn't have. >>> >>>    FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based >>>    on LLVM 6.0.1) >>>    Target: x86_64-unknown-freebsd12.0 >>>    Thread model: posix >>>    InstalledDir: /usr/bin >>> >>> anyone know if there is a clang equivalent of -Wp, -E,-lang-asm? > > In later GCC versions the cpp's -lang-asm seems to be deprecated in > favor of -x assembler-with-cpp as it conflicts with -l option. > > Could you try changing the -Wp,-E,-lang-asm to -Wp,-E,-xassembler-with-cpp? Just tried it myself, and if you indeed mean the third_party/aesni-intel/aesni-intel_asm.c, the following seems to work for me: clang -xassembler-with-cpp -c third_party/aesni-intel/aesni-intel_asm.c >>> possible work arrounds include: >>> >>> 1/ Get gcc/lld to produce a library from which lld can find the symbols >>> >>> 2/ find a way to compile this with clang but everything else with gcc? >>> >>> 3/ find a way to allow clang to use >>> -Wp,-E,-lang-asm >>> >>> whatever that means >>> >>> >>> Thoughts from any tools people?