[MacPorts] #61299: python3x: -Wno-unused-result in _sysconfigdata__darwin_darwin.py unrecognized by gcc 4.2

MacPorts noreply at macports.org
Sat Oct 10 08:04:22 UTC 2020


#61299: python3x: -Wno-unused-result in _sysconfigdata__darwin_darwin.py
unrecognized by gcc 4.2
-------------------------------------------------+-------------------------
  Reporter:  chrstphrchvz                        |      Owner:  jmroot
      Type:  defect                              |     Status:  assigned
  Priority:  Normal                              |  Milestone:
 Component:  ports                               |    Version:  2.6.3
Resolution:                                      |   Keywords:
      Port:  python37 python38 python39 py-      |
  cchardet py-pycryptodome py-fann2              |
-------------------------------------------------+-------------------------
Changes (by chrstphrchvz):

 * port:  python37 python38 python36 py-cchardet py-fann2 => python37
     python38 python39 py-cchardet py-pycryptodome py-fann2


Old description:

> Python 3.x ports build using `-Wno-unused-result`; this argument gets
> saved in `CFLAGS` and other variables in
> _sysconfigdata!__darwin_darwin.py, and is used again when building ports
> for Python modules. On macOS 10.6, Python itself is built using an
> alternative compiler (e.g. MacPorts' clang 3.7 or clang 9.0) which
> recognizes `-Wno-unused-result`, but modules (e.g. `py3x-cchardet`) might
> try to build using a system compiler (e.g. gcc 4.2) which doesn't
> recognize the option:
> {{{
> /usr/bin/gcc-4.2 -Wno-unused-result -Wsign-compare -Wunreachable-code
> -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/
> -Isrc/ext/uchardet/src
> -I/opt/local/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9
> -c src/cchardet/_cchardet.cpp -o
> build/temp.macosx-10.6-x86_64-3.9/src/cchardet/_cchardet.o
> cc1plus: error: unrecognized command line option "-Wno-unused-result"
> }}}
> Possibly related to #56458. Possibly present in `python35` or earlier but
> haven't checked. (I personally am not using macOS 10.6.)

New description:

 `python37`, `python38`, and `python39` ports build using `-Wno-unused-
 result`; this argument gets saved in `CFLAGS` and other variables in
 _sysconfigdata!__darwin_darwin.py, and is used again when building ports
 for Python modules. On macOS 10.6, Python itself is built using an
 alternative compiler (e.g. MacPorts' clang 3.7 or clang 9.0) which
 recognizes `-Wno-unused-result`, but modules (e.g. `py3x-cchardet`) might
 try to build using a system compiler (e.g. gcc 4.2) which doesn't
 recognize the option:
 {{{
 /usr/bin/gcc-4.2 -Wno-unused-result -Wsign-compare -Wunreachable-code
 -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/
 -Isrc/ext/uchardet/src
 -I/opt/local/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9
 -c src/cchardet/_cchardet.cpp -o
 build/temp.macosx-10.6-x86_64-3.9/src/cchardet/_cchardet.o
 cc1plus: error: unrecognized command line option "-Wno-unused-result"
 }}}
 Possibly related to #56458. (I personally am not using macOS 10.6.)

--

Comment:

 `python39` is affected; `python35` and `python36` are not affected.

 `py37-pycryptodome` and `py38-pycryptodome` are additional examples of
 ports failing to build on 10.6 because of this issue.

-- 
Ticket URL: <https://trac.macports.org/ticket/61299#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list