This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.27.9000-76-gdb9881e


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  db9881ecd7e7278af3e6bb252a0b3015e275d7bd (commit)
      from  3785b31c16a507538a9f67f20c75b8a1dfe9939a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=db9881ecd7e7278af3e6bb252a0b3015e275d7bd

commit db9881ecd7e7278af3e6bb252a0b3015e275d7bd
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Feb 15 23:48:47 2018 +0000

    Document use of CC and CFLAGS in more detail (bug 20980, bug 21234).
    
    There are some bug reports from people setting CFLAGS not including a
    -O option and then being confused when the build fails.  This patch
    addresses this by documenting the proper use of CC and CFLAGS in more
    detail - saying what options should go where and specifying the
    requirement to compile with optimization.
    
    The previous text incorrectly used @var markup with CC and CFLAGS.
    The correct markup for environment variables is @env, but it's also
    the case that passing such variables explicitly on the configure
    command line is preferred to passing them in the environment, so this
    patch changes the documentation to describe passing them on the
    command line (and uses @code).
    
    In many cases putting options in the wrong place may in fact work, but
    I believe what I've specified is the correct rule for which options to
    put where.
    
    	[BZ #20980]
    	[BZ #21234]
    	* manual/install.texi (Configuring and compiling): Describe
    	passing CC and CFLAGS on configure command line, not as
    	environment variables.  Use @code markup on those variables.
    	Specify what options go in CC and what go in CFLAGS.  Note the
    	requirement to compile with optimization.
    	* INSTALL: Regenerated.

diff --git a/ChangeLog b/ChangeLog
index 9bc1c16..c5696db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2018-02-15  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #20980]
+	[BZ #21234]
+	* manual/install.texi (Configuring and compiling): Describe
+	passing CC and CFLAGS on configure command line, not as
+	environment variables.  Use @code markup on those variables.
+	Specify what options go in CC and what go in CFLAGS.  Note the
+	requirement to compile with optimization.
+	* INSTALL: Regenerated.
+
 	[BZ #18124]
 	* sysdeps/hppa/bsd-setjmp.S: Include <sysdep.h>.
 	(setjmp): Use HIDDEN_JUMPTARGET with __sigsetjmp.
diff --git a/INSTALL b/INSTALL
index 64dec34..052b1b6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -36,9 +36,18 @@ normal setting to install as the standard system library is
 '--prefix=/usr' for GNU/Linux systems and '--prefix=' (an empty prefix)
 for GNU/Hurd systems.
 
-   It may also be useful to set the CC and CFLAGS variables in the
-environment when running 'configure'.  CC selects the C compiler that
-will be used, and CFLAGS sets optimization options for the compiler.
+   It may also be useful to pass 'CC=COMPILER' and 'CFLAGS=FLAGS'
+arguments to 'configure'.  'CC' selects the C compiler that will be
+used, and 'CFLAGS' sets optimization options for the compiler.  Any
+compiler options required for all compilations, such as options
+selecting an ABI or a processor for which to generate code, should be
+included in 'CC'.  Options that may be overridden by the GNU C Library
+build system for particular files, such as for optimization and
+debugging, should go in 'CFLAGS'.  The default value of 'CFLAGS' is '-g
+-O2', and the GNU C Library cannot be compiled without optimization, so
+if 'CFLAGS' is specified it must enable optimization.  For example:
+
+     $ ../glibc-VERSION/configure CC="gcc -m32" CFLAGS="-O3"
 
    The following list describes all of the available options for
 'configure':
@@ -210,7 +219,7 @@ will be used, and CFLAGS sets optimization options for the compiler.
      but you want to compile a library for 586es, give
      '--host=i586-pc-linux-gnu' or just '--host=i586-linux' and add the
      appropriate compiler flags ('-mcpu=i586' will do the trick) to
-     CFLAGS.
+     'CC'.
 
      If you specify just '--build', 'configure' will get confused.
 
@@ -304,7 +313,7 @@ makefiles.
 setting a few variables in 'configparms'.  Set 'CC' to the
 cross-compiler for the target you configured the library for; it is
 important to use this same 'CC' value when running 'configure', like
-this: 'CC=TARGET-gcc configure TARGET'.  Set 'BUILD_CC' to the compiler
+this: 'configure TARGET CC=TARGET-gcc'.  Set 'BUILD_CC' to the compiler
 to use for programs run on the build system as part of compiling the
 library.  You may need to set 'AR' to cross-compiling versions of 'ar'
 if the native tools are not configured to work with object files for the
diff --git a/manual/install.texi b/manual/install.texi
index 43dd8d6..4bbbfcf 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -59,10 +59,21 @@ but the normal setting to install as the standard system library is
 @samp{--prefix=/usr} for @gnulinuxsystems{} and @samp{--prefix=} (an
 empty prefix) for @gnuhurdsystems{}.
 
-It may also be useful to set the @var{CC} and @var{CFLAGS} variables in
-the environment when running @code{configure}.  @var{CC} selects the C
-compiler that will be used, and @var{CFLAGS} sets optimization options
-for the compiler.
+It may also be useful to pass @samp{CC=@var{compiler}} and
+@code{CFLAGS=@var{flags}} arguments to @code{configure}.  @code{CC}
+selects the C compiler that will be used, and @code{CFLAGS} sets
+optimization options for the compiler.  Any compiler options required
+for all compilations, such as options selecting an ABI or a processor
+for which to generate code, should be included in @code{CC}.  Options
+that may be overridden by the @glibcadj{} build system for particular
+files, such as for optimization and debugging, should go in
+@code{CFLAGS}.  The default value of @code{CFLAGS} is @samp{-g -O2},
+and @theglibc{} cannot be compiled without optimization, so if
+@code{CFLAGS} is specified it must enable optimization.  For example:
+
+@smallexample
+$ ../glibc-@var{version}/configure CC="gcc -m32" CFLAGS="-O3"
+@end smallexample
 
 The following list describes all of the available options for
  @code{configure}:
@@ -241,7 +252,7 @@ if @code{configure} guesses your machine as @code{i686-pc-linux-gnu} but
 you want to compile a library for 586es, give
 @samp{--host=i586-pc-linux-gnu} or just @samp{--host=i586-linux} and add
 the appropriate compiler flags (@samp{-mcpu=i586} will do the trick) to
-@var{CFLAGS}.
+@code{CC}.
 
 If you specify just @samp{--build}, @code{configure} will get confused.
 
@@ -339,8 +350,8 @@ It is easy to configure @theglibc{} for cross-compilation by
 setting a few variables in @file{configparms}.  Set @code{CC} to the
 cross-compiler for the target you configured the library for; it is
 important to use this same @code{CC} value when running
-@code{configure}, like this: @samp{CC=@var{target}-gcc configure
-@var{target}}.  Set @code{BUILD_CC} to the compiler to use for programs
+@code{configure}, like this: @samp{configure @var{target}
+CC=@var{target}-gcc}.  Set @code{BUILD_CC} to the compiler to use for programs
 run on the build system as part of compiling the library.  You may need to
 set @code{AR} to cross-compiling versions of @code{ar}
 if the native tools are not configured to work with

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    9 +++++++++
 INSTALL             |   19 ++++++++++++++-----
 manual/install.texi |   25 ++++++++++++++++++-------
 3 files changed, 41 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]