tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: discussion seeked for c++ variants in USE_LANGUAGES
Le 12/11/15 17:28, Richard PALO a écrit :
> Le 12/11/15 16:59, David Holland a écrit :
>> On Thu, Nov 12, 2015 at 03:07:38PM +0100, Richard PALO wrote:
>> > > Very likely a lot, both due to disabled GNU extensions and the
>> > > additional restrictions in the C namespace.
>> >
>> > Personally, I'd simply like clang and gcc to use the same -std= clause
>> > to simplify pkgsrc maintenance. Today that's not the case for c99 already.
>> >
>> > I'll give gcc with -std=c99 instead of -std=gnu99 a try just for grins.
>>
>> I'm not convinced there's any point. No two compilers will arbitrarily
>> reject the same set of programs, regardless of setting, so chasing
>> after uniformity of settings isn't going to accomplish anything.
>>
>
> But the question I pose here is with respect to GNU extensions, either they're
> enabled or not... seems incongruous to have -std=c99 for clang but -std=gnu99
> for gcc. I believe pkgsrc should at least be consistent (one way or t'other).
>
> From the clang getting started page:
>> Clang Compiler Driver (Drop-in Substitute for GCC)
>
> In any event, various cflags/cxxflags tend to be set for compiler-specific needs.
>
Well, I'm quite pleased with the results of using -std=c99 instead of
-std=gnu99. Too me it seems quite worth the trouble.
For my limited_list bulkbuild of just over 1.150 packages with gcc4.9,
I had mostly trivial modifications to make, which could be considered
upstream bugs(I guess).
to build quick and dirty:
> databases/shared-mime-info/Makefile
needed CPPFLAGS+=-D__EXTENSIONS__ on SunOS
> graphics/MesaLib/Makefile
ditto
> graphics/cairo/Makefile.common
needed CPPFLAGS+= -Dtypeof=__typeof__
> lang/mono/Makefile
needed CPPFLAGS+=-Dsun for SunOS
plus CPPFLAGS+=-Dasm=__asm__
> security/policykit/Makefile
+CPPFLAGS.SunOS+=-D__EXTENSIONS__
> shells/zsh/Makefile.common
+CPPFLAGS.SunOS+=-D__EXTENSIONS__
> x11/xf86-video-nouveau/Makefile
+CPPFLAGS+=-Dtypeof=__typeof__
> www/firefox24
+CPPFLAGS+=-Dtypeof=__typeof__
+ I needed to fix a bug in config/nsinstall (as well as for mail/thunderbird24)
missing an include to mozilla-config.h (bug hidden by using -std=gnu99)
> x11/modular-xorg-server
had numerous SunOS issues that I decided to patch in order to send upstream, including '#ifdef sun' instead of '#ifdef __sun' as well as
'asm' instead of '__asm__'.
finally
> chat/weechat
I also made a patchset on github and filed an upstream issue to make c99/XPG6.
Less than 1%, not shabby at all!
BTW my limited_list is:
> meta-pkgs/bulk-medium
> meta-pkgs/gnome
> meta-pkgs/modular-xorg
> meta-pkgs/py-tryton-platform
> meta-pkgs/pkg_developer
> editors/vim-gtk2
> sysutils/coreutils
> sysutils/gkrellm
> print/cups-filters
> mail/thunderbird24
> mail/thunderbird24-l10n
> www/firefox24
> www/firefox24-l10n
> www/elinks
> databases/pgadmin3
> databases/postgresql94-adminpack
> databases/postgresql94-client
> databases/postgresql94-datatypes
> databases/postgresql94-dblink
> databases/postgresql94-docs
> databases/postgresql94-fuzzystrmatch
> databases/postgresql94-monitoring
> databases/postgresql94-pgcrypto
> databases/postgresql94-plperl
> databases/postgresql94-plpython
> databases/postgresql94-pltcl
> databases/postgresql94-replicationtools
> databases/postgresql94-server
> databases/postgresql94-upgrade
> misc/libreoffice
> devel/meld
> devel/cscope
> devel/git
> devel/mercurial
> devel/py-hgnested
> devel/scmcvs
> devel/cvsdiff2patch
> print/evince-nautilus
> sysutils/nautilus-sendto
> devel/RBTools
> lang/clang
> lang/nodejs
> devel/exctags
It would be interesting to see about clang now (rather next weekend), but I am
already convinced as well that using '-std=gnuxx' in mk/compiler is wrong with c99, c11 and c++11.
For those cases *needing* gnu extensions, USE_LANGUAGES can simply be set to 'c' and 'c++' with the appropriate CFLAGS/CXXFLAGS added as already frequently done.
I've updated the patchset in place
> http://www.netbsd.org/~richard/0001-add-USE_LANGUAGES-support-for-c11-and-c-11.patch
--
Richard PALO
Home |
Main Index |
Thread Index |
Old Index