Bug 216356

Summary: devel/py-ice: fails to build with clang 4.0
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: freebsd-ports-bugs mailing list <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: dim, freebsd, grembo, kde
Priority: --- Keywords: needs-patch
Version: LatestFlags: bugzilla: maintainer-feedback? (freebsd)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216215
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215861
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216015
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216046
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216051
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216052
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216056
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216058
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216019
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216072
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216074
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216075
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216076
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216159
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216176
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216194
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216197
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216198
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216199
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216200
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216203
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216206
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216211
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216213
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216214
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216216
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216217
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216218
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216221
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216222
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216227
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216228
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216233
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216234
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216235
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216253
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216354
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216355
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216357
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216358
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216615
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216617
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216618
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216619
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216620
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216621
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216622
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216623
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216624
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216626
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216632
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216629
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216631
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216630
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216627
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216633
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216634
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216635
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216636
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216637
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216638
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216639
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216640
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216641
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216642
Bug Depends on:    
Bug Blocks: 216008    

Description Jan Beich freebsd_committer 2017-01-21 19:13:40 UTC
Operation.cpp:1685:70: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
                if(PyTuple_SET_ITEM(results.get(), info->pos, Unset) < 0)
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:2549:75: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(result.get(), 0, ok ? incTrue() : incFalse()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:2589:56: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(result.get(), 1, op.get()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:2830:73: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 0, ok ? incTrue() : incFalse()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:2870:54: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 1, op.get()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:2913:73: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 0, ok ? incTrue() : incFalse()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:2961:54: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 1, op.get()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3129:73: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 0, ok ? incTrue() : incFalse()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3177:54: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 1, op.get()) < 0)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3305:80: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
                    if(PyTuple_SET_ITEM(args.get(), info->pos + offset, Unset) < 0)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3332:83: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
    if(PyTuple_SET_ITEM(args.get(), PyTuple_GET_SIZE(args.get()) - 1, curr.get()) < 0)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3350:60: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 0, (PyObject*)obj) < 0) // PyTuple_SET_ITEM steals a reference.
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3701:54: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
    if(PyTuple_SET_ITEM(args.get(), start, ip.get()) < 0)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3713:56: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
    if(PyTuple_SET_ITEM(args.get(), start, curr.get()) < 0)
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Operation.cpp:3733:60: error: ordered comparison between pointer and zero ('PyObject *' (aka '_object *') and 'int')
        if(PyTuple_SET_ITEM(args.get(), 0, (PyObject*)obj) < 0) // PyTuple_SET_ITEM steals a reference.
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~

build log: http://sprunge.us/aUGD
regressed by: https://github.com/llvm-mirror/clang/commit/4b6ad14285f3
Comment 1 Jan Beich freebsd_committer 2017-01-21 19:14:33 UTC
The fix here would probably be similar to bug 216253.
Comment 2 commit-hook freebsd_committer 2017-01-29 21:40:07 UTC
A commit references this bug:

Author: grembo
Date: Sun Jan 29 21:39:30 UTC 2017
New revision: 432801
URL: https://svnweb.freebsd.org/changeset/ports/432801

Log:
  Allow building devel/py-ice with clang 4.0, based on bug report

  Tested that this still builds fine using previous versions of clang,
  didn't bump revision, as there is no functional change and it's
  a build time error.

  PR:		216356
  Reported by:	jbeich

Changes:
  head/devel/ice/files/patch-python-modules-IcePy-Operation.cpp
Comment 3 Michael Gmelin freebsd_committer 2017-01-29 21:51:43 UTC
I committed an updated version of the master port that fixes that specific issue (which seems like a general bug in how the API is used), also opened a pull request upstream[0].

I don't have the resources to test using clang 4.0 myself right now, so it would be great if you could give it a try and let me know if there are additional issues.

[0] https://github.com/zeroc-ice/ice/pull/15
Comment 4 Jan Beich freebsd_committer 2017-01-30 02:48:27 UTC
Not enough to unbreak with Clang 4.0 but I haven't tried base r312967 yet. Dimitry, do you see the error as well?

/usr/local/bin/python2.7 ../config/s2py.py --prefix Ice_ --no-package -I../../slice --ice ../../slice/Ice/BuiltinSequences.ice
Traceback (most recent call last):
  File "../config/s2py.py", line 22, in <module>
    import IcePy
ImportError: ../config/../python/IcePy.so: Undefined symbol "_ZN7IceUtil4TimeC1Ex"

build log: http://slexy.org/view/s20b7hOcqz
Comment 5 Dimitry Andric freebsd_committer 2017-01-30 14:40:06 UTC
(In reply to Jan Beich (mail not working) from comment #4)
> Not enough to unbreak with Clang 4.0 but I haven't tried base r312967 yet.
> Dimitry, do you see the error as well?
> 
> /usr/local/bin/python2.7 ../config/s2py.py --prefix Ice_ --no-package
> -I../../slice --ice ../../slice/Ice/BuiltinSequences.ice
> Traceback (most recent call last):
>   File "../config/s2py.py", line 22, in <module>
>     import IcePy
> ImportError: ../config/../python/IcePy.so: Undefined symbol
> "_ZN7IceUtil4TimeC1Ex"
> 
> build log: http://slexy.org/view/s20b7hOcqz

No, for me it builds fine, with installing Ice-3.6.3_1 (ports head as of r432840), and py27-Ice-3.6.3_1 then also installs without issue.
Comment 6 Jan Beich freebsd_committer 2017-01-30 16:55:21 UTC
(In reply to Dimitry Andric from comment #5)
I'm on base r312968 amd64 now, after removing existing packages the issue still occurs. Moving to bug 216609 since it's no longer related to Clang 4.0, this port builds fine with old libc++.