From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Coopersmith Subject: Re: Solaris & [PATCH libdrm 1/2] configure.ac: split -fvisibility and __attribute__((visibility)) checks Date: Sun, 22 Mar 2015 18:46:47 -0700 Message-ID: <550F7087.2040609@oracle.com> References: <1425904660-13743-1-git-send-email-emil.l.velikov@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000909060500090600080405" Return-path: Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by gabe.freedesktop.org (Postfix) with ESMTP id 24D1A6E41D for ; Sun, 22 Mar 2015 18:46:53 -0700 (PDT) In-Reply-To: <1425904660-13743-1-git-send-email-emil.l.velikov@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Emil Velikov Cc: Niveditha Rau , Thierry Reding , Stuart Kreitman , dri-devel@lists.freedesktop.org, Randy Fishel List-Id: dri-devel@lists.freedesktop.org This is a multi-part message in MIME format. --------------000909060500090600080405 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/ 9/15 05:37 AM, Emil Velikov wrote: > The former does not imply the latter and vice-versa. One such example is > the Sun compiler. > > Cc: Alan Coopersmith > Cc: Thierry Reding > Signed-off-by: Emil Velikov > --- > > Hi Alan, > Can you please take a look it this series covers the symbol visibility > issues mentioned earlier ? In theory it should work like a charm but I > cannot really test it :-\ Patch 1 of 2 breaks configure on Solaris - I get: checking for VALGRIND... no checking whether cc -xc99=%all supports __attribute__((visibility))... ./configure[13393]: set does not quote correctly, so add quotes: double-quote^J # substitution turns \\ into \, and sed turns \ into \.^J sed -n ^I"s//\\/g;^J^I s/^\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\)=\(.*\)/\1=2/p"^J ;; #(^J *)^J # : not found [No such file or directory] ./configure[13393]: {\1+set}: bad substitution ./configure[13992]: : cannot open ./configure[14000]: : cannot open ./configure[14032]: : cannot open ./configure[14051]: : cannot open ./configure[14128]: : cannot open ./configure[14139]: : cannot open ./configure[14150]: : cannot open ./configure[14435]: : cannot open ./configure[14563]: : cannot open ./configure[14603]: : cannot open ./configure[14610]: : cannot open ./configure[14639]: : cannot open ./configure[14671]: : cannot open ./configure[14740]: : cannot open ./configure[14744]: : cannot open ./configure[14778]: : cannot open ./configure[14928]: : cannot open ./configure[14948]: : cannot open ./configure[14962]: : cannot open ./configure[14966]: : cannot open configure: error: write failure creating It also generated new autoconf warnings generating the configure script: configure.ac:422: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from... ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from... configure.ac:422: the top level configure.ac:422: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from... ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from... configure.ac:422: the top level autoreconf: running: /net/also.us.oracle.com/export/alanc/autotools/install/bin/autoconf --force configure.ac:422: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from... ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from... configure.ac:422: the top level autoreconf: running: /net/also.us.oracle.com/export/alanc/autotools/install/bin/autoheader --force configure.ac:422: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from... ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from... configure.ac:422: the top level autoreconf: running: automake --add-missing --copy --force-missing configure.ac:422: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from... ../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from... configure.ac:422: the top level Both seem to have been caused by a misplaced close paren/brace pair and are fixed by: --- a/configure.ac +++ b/configure.ac @@ -422,7 +422,7 @@ AC_MSG_CHECKING([whether $CC supports __attribute__((visibility))]) AC_LINK_IFELSE([AC_LANG_PROGRAM([ int foo_default( void ) __attribute__((visibility("default"))); int foo_hidden( void ) __attribute__((visibility("hidden"))); -], HAVE_ATTRIBUTE_VISIBILITY="yes"; AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])]); +])], [HAVE_ATTRIBUTE_VISIBILITY="yes"; AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])); if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__((visibility))]) (Gotta love autoconf and the mysteries of proper [] placements.) After that I can build on Solaris with patch #1 applied, but patch #2 then breaks due to Solaris Studio 12.4 compilers being more pedantic about prototypes in headers having the external visibility declarations too - lots of errors of the form: "intel_bufmgr.c", line 60: redeclaration must have the same or more restrictive linker scoping: drm_intel_bo_alloc_for_render It looks like none of the headers have the drm_public attributes the compiler wants to see there. > Additionally can you guys build libdrm (barring the patch you sent the > other day), or you need some parts of this ancient patch > http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-libs/libdrm/files/libdrm-2.4.58-solaris.patch?view=markup That looks very much like an ancient patch we still have in our tree [1] since I never found out if we could upstream it or replace it from our former DRM team. Unfortunately, they're all gone now - I've cc'ed the people who picked up that work - I'd already asked Randy to look at it as part of the work he's doing to reconcile our DRM sources with upstream. [1] https://hg.java.net/hg/solaris-x11~x-s12-clone/file/4e6b5865e3ec/open-src/lib/libdrm/solaris-drm-port.patch I keep a subset in my local git repo to enable building from upstream since the raw upstream builds don't work without at least some of it. (See attached patches for that subset.) -- -Alan Coopersmith- alan.coopersmith@oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc --------------000909060500090600080405 Content-Type: text/plain; charset=UTF-8; name="0001-Make-data-passed-to-ioctl-s-on-Solaris-match-the-Sol.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-Make-data-passed-to-ioctl-s-on-Solaris-match-the-Sol.pa"; filename*1="tch" RnJvbSAyMTg2Y2M1OTQ2MDg1YzRmNmNmNWMxMTkxYWJmNzUxOGNiZjViMWJiIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBBbGFuIENvb3BlcnNtaXRoIDxhbGFuLmNvb3BlcnNt aXRoQHN1bi5jb20+CkRhdGU6IFR1ZSwgMTcgSnVuIDIwMDggMTU6NDc6MjMgLTA3MDAKU3Vi amVjdDogW1BBVENIOmxpYmRybSAxLzJdIE1ha2UgZGF0YSBwYXNzZWQgdG8gaW9jdGwncyBv biBTb2xhcmlzIG1hdGNoIHRoZQogU29sYXJpcyBrZXJuZWwgRFJJIGltcGxlbWVudGF0aW9u CgotLS0KIGluY2x1ZGUvZHJtL2RybS5oIHwgICAxMyArKysrKysrKysrKysrCiB4Zjg2ZHJt LmMgICAgICAgICB8ICAgIDcgKysrKysrKwogMiBmaWxlcyBjaGFuZ2VkLCAyMCBpbnNlcnRp b25zKCspCgpkaWZmIC0tZ2l0IGEvaW5jbHVkZS9kcm0vZHJtLmggYi9pbmNsdWRlL2RybS9k cm0uaAppbmRleCAyMjlhMjlmLi5lYzk2NjIwIDEwMDY0NAotLS0gYS9pbmNsdWRlL2RybS9k cm0uaAorKysgYi9pbmNsdWRlL2RybS9kcm0uaApAQCAtMjEwLDEyICsyMTAsMjIgQEAgc3Ry dWN0IGRybV9jdHhfcHJpdl9tYXAgewogICogXHNhIGRybUFkZE1hcCgpLgogICovCi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NlbmRpZgogCXN0cnVjdCBkcm1f YnVmX3B1YiAqbGlzdDsJLyoqPCBCdWZmZXIgaW5mb3JtYXRpb24gKi8KKyNpZmRlZiBfX3N1 bgorCWludCBmZDsKKyNlbmRpZgogfTsKIAogLyoqCmRpZmYgLS1naXQgYS94Zjg2ZHJtLmMg Yi94Zjg2ZHJtLmMKaW5kZXggZTczY2RkZC4uZmMyYzk1NiAxMDA2NDQKLS0tIGEveGY4NmRy bS5jCisrKyBiL3hmODZkcm0uYwpAQCAtMTA5Niw3ICsxMDk2LDExIEBAIGludCBkcm1SbU1h cChpbnQgZmQsIGRybV9oYW5kbGVfdCBoYW5kbGUpCiAgICAgZHJtX21hcF90IG1hcDsKIAog ICAgIG1lbWNsZWFyKG1hcCk7CisjaWZkZWYgX19zdW4KKyAgICBtYXAuaGFuZGxlID0gaGFu ZGxlOworI2Vsc2UKICAgICBtYXAuaGFuZGxlID0gKHZvaWQgKikodWludHB0cl90KWhhbmRs ZTsKKyNlbmRpZgogCiAgICAgaWYoZHJtSW9jdGwoZmQsIERSTV9JT0NUTF9STV9NQVAsICZt YXApKQogCXJldHVybiAtZXJybm87CkBAIC0xMzMwLDYgKzEzMzQsOSBAQCBkcm1CdWZNYXBQ dHIgZHJtTWFwQnVmcyhpbnQgZmQpCiAgICAgaW50ICAgICAgICAgICBpOwogCiAgICAgbWVt Y2xlYXIoYnVmcyk7CisjaWZkZWYgX19zdW4KKyAgICBidWZzLmZkID0gZmQ7CisjZW5kaWYK ICAgICBpZiAoZHJtSW9jdGwoZmQsIERSTV9JT0NUTF9NQVBfQlVGUywgJmJ1ZnMpKQogCXJl dHVybiBOVUxMOwogCi0tIAoxLjcuOS4yCgo= --------------000909060500090600080405 Content-Type: text/plain; charset=UTF-8; name="0002-Add-_IOC-definition-for-Solaris-OpenSolaris.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0002-Add-_IOC-definition-for-Solaris-OpenSolaris.patch" RnJvbSAyMWYwNzEwM2M5NGI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ICAgICAgICAgICAgIFwKKyAgICAoKGRpcikgPT0gRFJNX0lPQ19SRUFEV1JJVEUg PyBfSU9XUk4oKGdyb3VwKSwgKG5yKSwgKHNpemUpKSA6ICAgICAgIFwKKyAgICAgKChkaXIp ID09IERSTV9JT0NfV1JJVEUgPyBfSU9XTigoZ3JvdXApLCAobnIpLCAoc2l6ZSkpIDogICAg ICAgICAgIFwKKyAgICAgIC8qIChkaXIpID09IERSTV9JT0NfUkVBRCAqLyAgX0lPUk4oKGdy b3VwKSwgKG5yKSwgKHNpemUpKSApKQorI2VuZGlmCisKICNkZWZpbmUgRFJNX0lPQ1RMX05S KG4pICAgICAgICAgKChuKSAmIDB4ZmYpCiAjZGVmaW5lIERSTV9JT0NfVk9JRCAgICAgICAg ICAgIElPQ19WT0lECiAjZGVmaW5lIERSTV9JT0NfUkVBRCAgICAgICAgICAgIElPQ19PVVQK LS0gCjEuNy45LjIKCg== --------------000909060500090600080405 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --------------000909060500090600080405--