LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Where is make getting these build flags from? (https://www.linuxquestions.org/questions/%2Absd-17/where-is-make-getting-these-build-flags-from-4175542318/)

replica9000 05-11-2015 07:43 PM

Where is make getting these build flags from?
 
Code:

root@FreeVBox:/usr/ports/ftp/gftp # cat /etc/make.conf
CFLAGS=-O2 -pipe
COPFLAGS=-O2 -pipe
OPTIMIZED_FLAGS=YES
WITH_OPTIMIZED_FLAGS=YES
BUILD_OPTIMIZED=YES
MAKE_JOBS_NUMBER=4
MAKE_JOBS_SAFE=YES

Code:

root@FreeVBox:/usr/ports/ftp/gftp # make -dAF/tmp/gftp
Code:

root@FreeVBox:/usr/ports/ftp/gftp # cat /tmp/gftp | grep fomit
Command:OPTIMIZE = -02 -pipe -fomit-frame-pointer
ParseReadLine (265): 'OPTIMIZE = -02 -pipe -fomit-frame-pointer'
Global:OPTIMIZE = -02 -pipe -fomit-frame-pointer ignored!
Applying[OPTIMIZE] :Q to "-02 -pipe -fomit-frame-pointer"
QuoteMeta: [-02\ -pipe\ -fomit-frame-pointer]
Result[OPTIMIZE] of :Q is "-02\ -pipe\ -fomit-frame-pointer"
Result[.MAKEOVERRIDES] of :@ is ".MAKE.LEVEL.ENV=MAKELEVEL ARCH=amd64 CONFIG_DONE_GFTP=1 LIBPERL_A=libperl.a LINKTYPE=dynamic OPSYS=FreeBSD OPTIMIZE=-02\ -pipe\ -fomit-frame-pointer OSREL=11.0 OSVERSION=1100073 PREFIX=/usr/local SYSTEMVERSION="
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
cc -c  -I/usr/local/include  -O2 -pipe  -fstack-protector -fno-strict-aliasing -02 -pipe -fomit-frame-pointer    -DVERSION=\"2.41\"  -DXS_VERSION=\"2.41\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.16/mach/CORE"  Expat.c
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
OPTIMIZE        = -02 -pipe -fomit-frame-pointer


rtmistler 05-12-2015 12:50 PM

Well the -O2 and -pipe are from either the CFLAGS or the COPFLAGS, but there's not enough information to discern where the -fomit-frame-pointer is coming from. Where's the actual Makefile?

replica9000 05-12-2015 03:16 PM

Quote:

Originally Posted by rtmistler (Post 5361511)
Well the -O2 and -pipe are from either the CFLAGS or the COPFLAGS, but there's not enough information to discern where the -fomit-frame-pointer is coming from. Where's the actual Makefile?

Well the 2nd -O2 is actually -02 (zero two), and it's that that is throwing errors while compiling.

What's highlighted in green is coming from /etc/make.conf. What's highlighted in red is what I'm trying to find the source of. It doesn't show up an an environmental variable.
Code:

cc -c  -I/usr/local/include  -O2 -pipe  -fstack-protector -fno-strict-aliasing -02 -pipe -fomit-frame-pointer

ntubski 05-12-2015 03:29 PM

Quote:

Originally Posted by replica9000 (Post 5361147)
Code:

root@FreeVBox:/usr/ports/ftp/gftp # make -dAF/tmp/gftp

What do the options A and F do? I don't see them in the GNU make manual, nor the FreeBSD one.

EDIT: oops, it's actually under the -d (debug) flag in the BSD one.

Quote:

Originally Posted by rtmistler
Where's the actual Makefile?

Seconded.

replica9000 05-12-2015 04:15 PM

Quote:

Originally Posted by rtmistler (Post 5361511)
Where's the actual Makefile?

It's not just one Makefile. This error has popped up under multiple sources under /usr/ports.

Quote:

Originally Posted by ntubski (Post 5361579)
What do the options A and F do? I don't see them in the GNU make manual, nor the FreeBSD one.

I got the info from man make

Code:

-d [-]flags
            Turn on debugging, and specify which portions of make are to
            print debugging information.  Unless the flags are preceded by
            `-' they are added to the MAKEFLAGS environment variable and will
            be processed by any child make processes.  By default, debugging
            information is printed to standard error, but this can be changed
            using the F debugging flag.  The debugging output is always
            unbuffered; in addition, if debugging is enabled but debugging
            output is not directed to standard output, then the standard
            output is line buffered.  Flags is one or more of the following:

            A      Print all possible debugging information; equivalent to
                    specifying all of the debugging flags.

            F[+]filename
                    Specify where debugging output is written.  This must be
                    the last flag, because it consumes the remainder of the
                    argument.  If the character immediately after the `F'
                    flag is `+', then the file will be opened in append mode;
                    otherwise the file will be overwritten.  If the file name
                    is `stdout' or `stderr' then debugging output will be
                    written to the standard output or standard error output
                    file descriptors respectively (and the `+' option has no
                    effect).  Otherwise, the output will be written to the
                    named file.  If the file name ends `.%d' then the `%d' is
                    replaced by the pid.


ntubski 05-12-2015 08:02 PM

Quote:

Originally Posted by replica9000 (Post 5361575)
What's highlighted in red is what I'm trying to find the source of. It doesn't show up an an environmental variable.

If it's not from the environment, it must be from a file. You could use ktrace+kdump to find all the files which are opened, then grep them for the offending string.

replica9000 05-12-2015 08:03 PM

Where does make get the OPTIMIZE value from?

Code:

% cat /tmp/gftp | grep OPTIMIZE
Global:delete OPTIMIZE (not found)
Command:OPTIMIZE = -02 -pipe -fomit-frame-pointer
Global:.MAKEOVERRIDES =  .MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP OPSYS OSREL OSVERSION SYSTEMVERSION LIBPERL_A LINKTYPE OPTIMIZE
Global:.MAKEOVERRIDES =  .MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP OPSYS OSREL OSVERSION SYSTEMVERSION LIBPERL_A LINKTYPE OPTIMIZE PREFIX
ParseReadLine (3): 'OPTIMIZED_FLAGS=YES'
Global:OPTIMIZED_FLAGS = YES
ParseReadLine (4): 'WITH_OPTIMIZED_FLAGS=YES'
Global:WITH_OPTIMIZED_FLAGS = YES
ParseReadLine (265): 'OPTIMIZE = -02 -pipe -fomit-frame-pointer'
Global:OPTIMIZE = -02 -pipe -fomit-frame-pointer ignored!
ParseReadLine (285): 'CCCMD = $(CC) -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION)'
Global:CCCMD = $(CC) -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION)
ParseReadLine (296): 'PASTHRU = LIBPERL_A="$(LIBPERL_A)" LINKTYPE="$(LINKTYPE)" OPTIMIZE="$(OPTIMIZE)" PREFIX="$(PREFIX)" PASTHRU_INC="$(PASTHRU_INC)"'
Global:PASTHRU = LIBPERL_A="$(LIBPERL_A)" LINKTYPE="$(LINKTYPE)" OPTIMIZE="$(OPTIMIZE)" PREFIX="$(PREFIX)" PASTHRU_INC="$(PASTHRU_INC)"
ParseReadLine (312): '        cc -E -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i'
Applying[.MAKEOVERRIDES] :O to " .MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP OPSYS OSREL OSVERSION SYSTEMVERSION LIBPERL_A LINKTYPE OPTIMIZE PREFIX"
Result[.MAKEOVERRIDES] of :O is ".MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP LIBPERL_A LINKTYPE OPSYS OPTIMIZE OSREL OSVERSION PREFIX SYSTEMVERSION"
Applying[.MAKEOVERRIDES] :u to ".MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP LIBPERL_A LINKTYPE OPSYS OPTIMIZE OSREL OSVERSION PREFIX SYSTEMVERSION"
Result[.MAKEOVERRIDES] of :u is ".MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP LIBPERL_A LINKTYPE OPSYS OPTIMIZE OSREL OSVERSION PREFIX SYSTEMVERSION"
Applying[.MAKEOVERRIDES] :@ to ".MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP LIBPERL_A LINKTYPE OPSYS OPTIMIZE OSREL OSVERSION PREFIX SYSTEMVERSION"
Command:v = OPTIMIZE
Applying[OPTIMIZE] :Q to "-02 -pipe -fomit-frame-pointer"
Result[OPTIMIZE] of :Q is "-02\ -pipe\ -fomit-frame-pointer"
Result[.MAKEOVERRIDES] of :@ is ".MAKE.LEVEL.ENV=MAKELEVEL ARCH=amd64 CONFIG_DONE_GFTP=1 LIBPERL_A=libperl.a LINKTYPE=dynamic OPSYS=FreeBSD OPTIMIZE=-02\ -pipe\ -fomit-frame-pointer OSREL=11.0 OSVERSION=1100073 PREFIX=/usr/local SYSTEMVERSION="
OPTIMIZED_FLAGS  = YES
WITH_OPTIMIZED_FLAGS = YES
PASTHRU          = LIBPERL_A="$(LIBPERL_A)" LINKTYPE="$(LINKTYPE)" OPTIMIZE="$(OPTIMIZE)" PREFIX="$(PREFIX)" PASTHRU_INC="$(PASTHRU_INC)"
CCCMD            = $(CC) -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION)
.MAKEOVERRIDES  =  .MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP OPSYS OSREL OSVERSION SYSTEMVERSION LIBPERL_A LINKTYPE OPTIMIZE PREFIX
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
        cc -E -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i
OPTIMIZED_FLAGS  = YES
WITH_OPTIMIZED_FLAGS = YES
PASTHRU          = LIBPERL_A="$(LIBPERL_A)" LINKTYPE="$(LINKTYPE)" OPTIMIZE="$(OPTIMIZE)" PREFIX="$(PREFIX)" PASTHRU_INC="$(PASTHRU_INC)"
CCCMD            = $(CC) -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION)
.MAKEOVERRIDES  =  .MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP OPSYS OSREL OSVERSION SYSTEMVERSION LIBPERL_A LINKTYPE OPTIMIZE PREFIX
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
        cc -E -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i
OPTIMIZED_FLAGS  = YES
WITH_OPTIMIZED_FLAGS = YES
PASTHRU          = LIBPERL_A="$(LIBPERL_A)" LINKTYPE="$(LINKTYPE)" OPTIMIZE="$(OPTIMIZE)" PREFIX="$(PREFIX)" PASTHRU_INC="$(PASTHRU_INC)"
CCCMD            = $(CC) -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION)
.MAKEOVERRIDES  =  .MAKE.LEVEL.ENV .MAKE.LEVEL.ENV ARCH CONFIG_DONE_GFTP OPSYS OSREL OSVERSION SYSTEMVERSION LIBPERL_A LINKTYPE OPTIMIZE PREFIX
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
        cc -E -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i
OPTIMIZED_FLAGS  = YES
WITH_OPTIMIZED_FLAGS = YES
PASTHRU          = LIBPERL_A="$(LIBPERL_A)" LINKTYPE="$(LINKTYPE)" OPTIMIZE="$(OPTIMIZE)" PREFIX="$(PREFIX)"
CCCMD            = $(CC) -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION)
OPTIMIZE        = -02 -pipe -fomit-frame-pointer
        cc -E -c $(PASTHRU_INC) $(INC)  $(CCFLAGS) $(OPTIMIZE)  $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION)  $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i


rtmistler 05-13-2015 07:18 AM

I'm assuming you've grep'ed for these variable names within the build hierarchy as well as your home and tools environment? If somewhere there is a DASH-OH-TWO as opposed to DASH-ZERO-TWO then THAT should be relatively easy to find, not in the log file but in a file used by the build to establish variables.

Version of make? Note also that I have gnumake 3.8.1 and it does not contain the -A flag.

Makefile?

The debug output doesn't help here. Once the Makefile is posted, it's likely that there will be other support files requested, there's probably an import or include of information/variables within the make which would cause this.

I also ran a make -d and searched the output for variables being resolved and it showed absolutely nothing on that subject. Therefore I suspect whatever debug you add to make, may not get the job done.

replica9000 05-13-2015 11:04 AM

My make version is 20150505 from FREEBSD 11.0-CURRENT

When I upgraded to 11.0-CURRENT, I had wiped out both /usr/src and /usr/ports, and used svn to get the new sources. I haven't modified /etc/make.conf or specified make flags anywhere else after that.

What's weird is that when I make buildworld under /usr/src, those flags aren't there. But when I try to build something under /usr/ports, that's when they show up.

replica9000 05-13-2015 12:13 PM

Found it!

Code:

# grep -r '02 -pipe -fomit' /usr
/usr/local/lib/perl5/5.16/mach/Config_heavy.pl:config_arg19='-Doptimize=-02 -pipe -fomit-frame-pointer'
/usr/local/lib/perl5/5.16/mach/Config_heavy.pl:config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.16/mach -Dprivlib=/usr/local/lib/perl5/5.16 -Dman3dir=/usr/local/lib/perl5/5.16/perl/man/man3 -Dman1dir=/usr/local/man/man1 -Dsitearch=/usr/local/lib/perl5/site_perl/5.16/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.16 -Dscriptdir=/usr/local/bin -Dsiteman3dir=/usr/local/lib/perl5/5.16/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dcc=cc -Duseshrplib -Dinc_version_list=none -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.16/BSDPAN" -Doptimize=-02 -pipe -fomit-frame-pointer -Ui_gdbm -Dusethreads=y -Dusemymalloc=n -Duse64bitint'
/usr/local/lib/perl5/5.16/mach/Config_heavy.pl:optimize='-02 -pipe -fomit-frame-pointer'

Updated perl5, and now those entries in that file reflect what /etc/make.conf shows. Looks like anytime I edit /etc/make.conf, I'll have to update perl also.


All times are GMT -5. The time now is 02:31 PM.