Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2260

Compile warning "_POSIX_C_SOURCE" redefined on RHEL 7.0 with Python 2.7.5

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.11
    • Component/s: None
    • Labels:
      None

      Description

      Compile warnings on RHEL 7.0 with Python 2.7.5:
      https://evergreen.mongodb.com/task/mongo_python_driver_tests_all__platform~rhel70_auth_ssl~auth_ssl_test_4.4_standalone_0eace78cf483ceecaf308cf7bdcec50e8e50ed7e_20_05_19_18_20_23

       [2020/05/22 03:02:48.425] Running auth tests over ssl with python python
       [2020/05/22 03:02:48.621] 2.7.5 (default, May  3 2017, 07:55:04)
       [2020/05/22 03:02:48.621] [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
       [2020/05/22 03:02:48.621] running clean
       [2020/05/22 03:02:48.778] running build_ext
       [2020/05/22 03:02:48.778] building 'bson._cbson' extension
       [2020/05/22 03:02:48.778] creating build
       [2020/05/22 03:02:48.778] creating build/temp.linux-x86_64-2.7
       [2020/05/22 03:02:48.778] creating build/temp.linux-x86_64-2.7/bson
       [2020/05/22 03:02:48.778] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibson -I/usr/include/python2.7 -c bson/_cbsonmodule.c -o build/temp.linux-x86_64-2.7/bson/_cbsonmodule.o
       [2020/05/22 03:02:49.454] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibson -I/usr/include/python2.7 -c bson/time64.c -o build/temp.linux-x86_64-2.7/bson/time64.o
       [2020/05/22 03:02:49.616] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibson -I/usr/include/python2.7 -c bson/buffer.c -o build/temp.linux-x86_64-2.7/bson/buffer.o
       [2020/05/22 03:02:49.631] In file included from /usr/include/python2.7/pyconfig.h:6:0,
       [2020/05/22 03:02:49.631]                  from /usr/include/python2.7/Python.h:8,
       [2020/05/22 03:02:49.631]                  from bson/buffer.c:22:
       [2020/05/22 03:02:49.631] /usr/include/python2.7/pyconfig-64.h:1188:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
       [2020/05/22 03:02:49.631]  #define _POSIX_C_SOURCE 200112L
       [2020/05/22 03:02:49.631]  ^
       [2020/05/22 03:02:49.631] In file included from /usr/include/stdlib.h:24:0,
       [2020/05/22 03:02:49.631]                  from bson/buffer.c:17:
       [2020/05/22 03:02:49.631] /usr/include/features.h:168:0: note: this is the location of the previous definition
       [2020/05/22 03:02:49.631]  # define _POSIX_C_SOURCE 200809L
       [2020/05/22 03:02:49.631]  ^
       [2020/05/22 03:02:49.631] In file included from /usr/include/python2.7/pyconfig.h:6:0,
       [2020/05/22 03:02:49.631]                  from /usr/include/python2.7/Python.h:8,
       [2020/05/22 03:02:49.631]                  from bson/buffer.c:22:
       [2020/05/22 03:02:49.631] /usr/include/python2.7/pyconfig-64.h:1210:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
       [2020/05/22 03:02:49.631]  #define _XOPEN_SOURCE 600
       [2020/05/22 03:02:49.631]  ^
       [2020/05/22 03:02:49.631] In file included from /usr/include/stdlib.h:24:0,
       [2020/05/22 03:02:49.631]                  from bson/buffer.c:17:
       [2020/05/22 03:02:49.631] /usr/include/features.h:170:0: note: this is the location of the previous definition
       [2020/05/22 03:02:49.631]  # define _XOPEN_SOURCE 700
       [2020/05/22 03:02:49.631]  ^
       [2020/05/22 03:02:49.680] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibson -I/usr/include/python2.7 -c bson/encoding_helpers.c -o build/temp.linux-x86_64-2.7/bson/encoding_helpers.o
       [2020/05/22 03:02:49.702] gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/bson/_cbsonmodule.o build/temp.linux-x86_64-2.7/bson/time64.o build/temp.linux-x86_64-2.7/bson/buffer.o build/temp.linux-x86_64-2.7/bson/encoding_helpers.o -L/usr/lib64 -lpython2.7 -o /data/mci/4a24ec93af0a84cc227ee30367c6dceb/src/bson/_cbson.so
       [2020/05/22 03:02:49.723] building 'pymongo._cmessage' extension
       [2020/05/22 03:02:49.723] creating build/temp.linux-x86_64-2.7/pymongo
       [2020/05/22 03:02:49.723] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibson -I/usr/include/python2.7 -c pymongo/_cmessagemodule.c -o build/temp.linux-x86_64-2.7/pymongo/_cmessagemodule.o
       [2020/05/22 03:02:50.064] gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ibson -I/usr/include/python2.7 -c bson/buffer.c -o build/temp.linux-x86_64-2.7/bson/buffer.o
       [2020/05/22 03:02:50.080] In file included from /usr/include/python2.7/pyconfig.h:6:0,
       [2020/05/22 03:02:50.080]                  from /usr/include/python2.7/Python.h:8,
       [2020/05/22 03:02:50.080]                  from bson/buffer.c:22:
       [2020/05/22 03:02:50.080] /usr/include/python2.7/pyconfig-64.h:1188:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
       [2020/05/22 03:02:50.080]  #define _POSIX_C_SOURCE 200112L
       [2020/05/22 03:02:50.080]  ^
       [2020/05/22 03:02:50.080] In file included from /usr/include/stdlib.h:24:0,
       [2020/05/22 03:02:50.080]                  from bson/buffer.c:17:
       [2020/05/22 03:02:50.080] /usr/include/features.h:168:0: note: this is the location of the previous definition
       [2020/05/22 03:02:50.080]  # define _POSIX_C_SOURCE 200809L
       [2020/05/22 03:02:50.080]  ^
       [2020/05/22 03:02:50.080] In file included from /usr/include/python2.7/pyconfig.h:6:0,
       [2020/05/22 03:02:50.080]                  from /usr/include/python2.7/Python.h:8,
       [2020/05/22 03:02:50.080]                  from bson/buffer.c:22:
       [2020/05/22 03:02:50.080] /usr/include/python2.7/pyconfig-64.h:1210:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
       [2020/05/22 03:02:50.080]  #define _XOPEN_SOURCE 600
       [2020/05/22 03:02:50.080]  ^
       [2020/05/22 03:02:50.080] In file included from /usr/include/stdlib.h:24:0,
       [2020/05/22 03:02:50.080]                  from bson/buffer.c:17:
       [2020/05/22 03:02:50.080] /usr/include/features.h:170:0: note: this is the location of the previous definition
       [2020/05/22 03:02:50.080]  # define _XOPEN_SOURCE 700
       [2020/05/22 03:02:50.080]  ^
       [2020/05/22 03:02:50.130] gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/pymongo/_cmessagemodule.o build/temp.linux-x86_64-2.7/bson/buffer.o -L/usr/lib64 -lpython2.7 -o /data/mci/4a24ec93af0a84cc227ee30367c6dceb/src/pymongo/_cmessage.so
       [2020/05/22 03:02:50.506] running test
       [2020/05/22 03:02:50.506] running egg_info
       [2020/05/22 03:02:50.506] creating pymongo.egg-info
       [2020/05/22 03:02:50.506] writing requirements to pymongo.egg-info/requires.txt
       [2020/05/22 03:02:50.506] writing pymongo.egg-info/PKG-INFO
       [2020/05/22 03:02:50.506] writing top-level names to pymongo.egg-info/top_level.txt
       [2020/05/22 03:02:50.507] writing dependency_links to pymongo.egg-info/dependency_links.txt
       [2020/05/22 03:02:50.507] writing manifest file 'pymongo.egg-info/SOURCES.txt'
       [2020/05/22 03:02:50.510] reading manifest file 'pymongo.egg-info/SOURCES.txt'
       [2020/05/22 03:02:50.510] reading manifest template 'MANIFEST.in'
       [2020/05/22 03:02:56.569] test_uri_options (test_auth.TestAuthURIOptions) ... ok
      

      Looks like this was caused by the #include "Python.h" added in PYTHON-2188.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shane.harvey Shane Harvey
              Reporter:
              shane.harvey Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: