Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 522304 - net-fs/nfs-utils-1.2.9 with sys-libs/uclibc on hardened: including stdlib.h doesn't define NULL
Summary: net-fs/nfs-utils-1.2.9 with sys-libs/uclibc on hardened: including stdlib.h d...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: uclibc-porting
  Show dependency tree
 
Reported: 2014-09-07 12:20 UTC by Sam
Modified: 2018-10-14 12:15 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix NULL undeclared identifier (nfs-utils-1.2.9-uclibc.patch,244 bytes, patch)
2014-09-07 12:20 UTC, Sam
Details | Diff
build log unpatched; compiler throws NULL undeclared identifier (nfs-utils-1.2.9-r3:20140908-201512.log,66.27 KB, text/plain)
2014-09-08 18:21 UTC, Sam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam 2014-09-07 12:20:26 UTC
When trying to emerge nfs-utils on a lilblue system (gentoo hardened + uclibc + xfce4) I ran into a number of rpcbind and libtirpc problems fixed in other bugs. The last problem is that nfs-utils itself throws a NULL undeclared identifier.

Please find attached a patch to fix this.
Comment 1 Sam 2014-09-07 12:20:55 UTC
Created attachment 384336 [details, diff]
patch to fix NULL undeclared identifier
Comment 2 Sam 2014-09-07 18:10:09 UTC
FYI, other bugs are for libtirpc: bug #371615 and for rpcbind: bug #458024
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-09-08 08:59:27 UTC
What error message would the patch fix?
Comment 4 Sam 2014-09-08 18:19:08 UTC
NULL undeclared identifier, see attach
Comment 5 Sam 2014-09-08 18:21:08 UTC
Created attachment 384398 [details]
build log unpatched; compiler throws NULL undeclared identifier
Comment 6 SpanKY gentoo-dev 2014-09-18 21:02:57 UTC
Comment on attachment 384336 [details, diff]
patch to fix NULL undeclared identifier

sockaddr.h is already including stdlib.h and POSIX requires that to define NULL:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html

explicitly pulling in stddef.h isn't the way to go here.
Comment 7 SpanKY gentoo-dev 2014-09-18 21:04:58 UTC
probably want to go into that dir and run gcc -E -dD to see why NULL isn't being defined.  on a uClibc system, this is working for me:
$ gcc -E -dD -P - <<<"#include <stdlib.h>" |& grep NULL
Comment 8 Sam 2014-09-21 19:16:30 UTC
That command gives among the output:
#define NULL ((void *)0)

.. which I'm guessing means that NULL normally gets defined properly out of stdlib.h?

I also tried running gcc -E -dD on several files in the workdir. Most of them terminate with a fatal 'no such file or directory' error. Some with NULL defined, others without. Not sure whether it's normal gcc doesn't find the header files? I'm sorry to say I'm completely unfamiliar with these kinds of things..
Comment 9 Anthony Basile gentoo-dev 2018-10-14 12:15:44 UTC
sys-libs/uclibc has been removed from the tree, replaced by sys-libs/uclibc-ng.  if this is still a problem on uclibc-ng, please open a new bug.