in reply to ExtUtils::CBuilder->compile() ignores flags

The config from the constructor should override the Config value, if I read the code correctly.

Maybe the flags are coming from a different option? Examine $Config{ccflags}, or existence of $ENV{CFLAGS} etc. Maybe add debugging prints to the source of Base.pm to show what values it processes and how?

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: ExtUtils::CBuilder->compile() ignores flags
by bliako (Abbot) on Jan 04, 2019 at 19:22 UTC

    I have emptied CFLAGS (edit:and CCFLAGS, and from the prompt): $ENV{CFLAGS}=''; but no change...

    So, I did this:

    # before compile() is called (and after new()) $cbuilder->{config}->{ccflags} =~ s/(?<=\s)\-O[0-9]{0,2}(?=\s|$)//g; # + remove -OXX $cbuilder->{config}->{ccflags} =~ s/(?<=\s)\-g(?=\s|$)//g # remove -g

    Thanks