Closed Bug 1371266 Opened 5 years ago Closed 5 years ago
gcc5 - libpng build failure due missing -std=c89
User Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:52.0) Gecko/20100101 Firefox/52.0 Build ID: 20170605042312 Steps to reproduce: 0:59.21 gmake: Entering directory '/var/tmp/firefox/obj-x86_64-pc-solaris2.12/media/libpng' 0:59.22 /usr/bin/gcc -std=gnu99 -o Unified_c_media_libpng0.o -c -I/var/tmp/firefox/obj-x86_64-pc-solaris2.12/dist/system_wrappers -include /var/tmp/firefox/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DMOZ_PNG_USE_INTEL_SSE -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/var/tmp/firefox/media/libpng -I/var/tmp/firefox/obj-x86_64-pc-solaris2.12/media/libpng -I/var/tmp/firefox/obj-x86_64-pc-solaris2.12/dist/include -I/var/tmp/firefox/obj-x86_64-pc-solaris2.12/dist/include/nspr -I/var/tmp/firefox/obj-x86_64-pc-solaris2.12/dist/include/nss -fPIC -include /var/tmp/firefox/obj-x86_64-pc-solaris2.12/mozilla-config.h -DMOZILLA_CLIENT -MD -MP -MF .deps/Unified_c_media_libpng0.o.pp -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wformat -fno-strict-aliasing -fno-math-errno -pthread -pipe -g -O -fno-omit-frame-pointer /var/tmp/firefox/obj-x86_64-pc-solaris2.12/media/libpng/Unified_c_media_libpng0.c 0:59.24 gmake: Entering directory '/var/tmp/firefox/obj-x86_64-pc-solaris2.12/gfx/sfntly/cpp/src' 0:59.24 gmake: Nothing to be done for 'target'. 0:59.24 gmake: Leaving directory '/var/tmp/firefox/obj-x86_64-pc-solaris2.12/gfx/sfntly/cpp/src' 0:59.38 In file included from /usr/include/stdlib.h:11:0, 0:59.38 from /var/tmp/firefox/obj-x86_64-pc-solaris2.12/dist/system_wrappers/stdlib.h:3, 0:59.38 from /var/tmp/firefox/media/libpng/intel/../pngpriv.h:42, 0:59.38 from /var/tmp/firefox/media/libpng/intel/filter_sse2_intrinsics.c:15, 0:59.38 from /var/tmp/firefox/obj-x86_64-pc-solaris2.12/media/libpng/Unified_c_media_libpng0.c:2: 0:59.39 /usr/gcc/5/lib/gcc/x86_64-pc-solaris2.12/5.4.0/include-fixed/sys/feature_tests.h:399:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications" 0:59.39 #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \ 0:59.39 ^ This is due Firefox build don't use -std=c89 as it's was fixed in libpng here: https://github.com/glennrp/libpng/commit/12e63e91af1378225993b36e25ce3252b54e751a
There are two possible issues to consider with this patch: - should we add -std=c89 always? or add some test and decide based on results? where? - there seems to be always -std=gnu99, when we add -std=c89 there are two -std. it works because the later wins. is it ok? or how to remove -std=gnu99? The other possibility would be to remove '#define _POSIX_SOURCE 1' from: media/libpng/pngpriv.h
Attachment #8875712 - Flags: review?(glennrp+bmo)
Comment on attachment 8875712 [details] [diff] [review] Bug1371266.patch R+; it's essentially the same as what libpng's configure.ac does.
Attachment #8875712 - Flags: review?(glennrp+bmo) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/1fd26e219e34 libpng should be built with -std=c89. r=glennrp
You need to log in before you can comment on or make changes to this bug.