Issue 118595 - IP clearance: Remove glibc
Summary: IP clearance: Remove glibc
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: external prerequisites (show other issues)
Version: 4.0.0-dev
Hardware: PC All
: P3 Blocker (vote)
Target Milestone: ---
Assignee: Andre
QA Contact:
URL:
Keywords:
Depends on: 118568
Blocks: 118566
  Show dependency treegraph
 
Reported: 2011-11-10 12:34 UTC by Andre
Modified: 2013-02-21 23:22 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Remove local copy of glibc and its use. (8.15 KB, patch)
2011-11-11 13:19 UTC, Andre
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Andre 2011-11-10 12:34:22 UTC
The glibc library has LGPL license, which is incompatible with Apache license.  Therefore the glibc directory has to be removed from the "external" module.
Comment 1 Andre 2011-11-11 12:22:48 UTC
Good news.  It looks like removing glibc will improve the code base.  It provides two sets of functions, getopt() for parsing command lines and the readdir family for reading the contents of directories.  

The getopt() function is used in two places: idlc, which is about to be removed for issue 118568, and rscdep, where it is used incorrectly.  Removing its used from rscdep will improve that program.

The family of readdir functions is not used at all an non Unix like operation systems.  On Windows the similar family of findfirst functions is used instead.
Comment 2 Andre 2011-11-11 12:24:27 UTC
Added issue 118568 as prerequisite, because idlc has to be removed before glibc can be removed.
Comment 3 Andre 2011-11-11 13:19:00 UTC
Created attachment 76998 [details]
Remove local copy of glibc and its use.

Removal of glibc from the external module.

Removal of the use of getopt() from rscdep.
Comment 4 Pedro Giffuni 2011-11-13 23:29:39 UTC
(In reply to comment #1)
> Good news.  It looks like removing glibc will improve the code base.  It
> provides two sets of functions, getopt() for parsing command lines and the
> readdir family for reading the contents of directories.  
> 
> The getopt() function is used in two places: idlc, which is about to be removed
> for issue 118568, and rscdep, where it is used incorrectly.  Removing its used
> from rscdep will improve that program.
> 

My understanding is idlc will remain and that only the preprocessor will be
replaced with a smaller and more portable.

We did find this portable implementation from OpenBSD if you need it:
http://cgit.freedesktop.org/mesa/mesa/tree/src/getopt
Comment 5 Pedro Giffuni 2011-11-14 07:08:01 UTC
(In reply to comment #4)

> > The getopt() function is used in two places: idlc, which is about to be removed
> > for issue 118568, and rscdep, where it is used incorrectly.  Removing its used
> > from rscdep will improve that program.
> > 
>

Nevermind ... I opengroked it and you are right, the only occurence of
getopt() there will go.
Comment 6 Pedro Giffuni 2011-11-15 16:14:43 UTC
I made a partial commit of this.

The glibc dependency remains until the idlc preproc is updated
but at least we can test the rest of this patch for now.

svn commit -m "i118595 - Removal of the use of getopt() from rscdep. Patch by Andre."
Sending        tools/Executable_rscdep.mk
Sending        tools/bootstrp/rscdep.cxx
Transmitting file data ..
Committed revision 1202270.

Thanks!
Comment 7 Andre 2011-12-02 12:33:49 UTC
Commited the rest of the glibc removal.

SVN revision is 1209447.
Comment 8 hdu@apache.org 2012-01-30 13:32:09 UTC
Closing resolved issue.