bugGNU Octave - Bugs: bug #48302, configure: fltk-config leaks too...

 
 

bug #48302: configure: fltk-config leaks too many compiler options into FLTK_CPPFLAGS

Submitter:  Michael Godfrey <godfrey>
Submitted:  Thu 23 Jun 2016 03:45:19 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Godfrey Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 27 Jun 2016 07:48:28 PM UTC, comment #14: 
Mike Miller <mtmiller>
Group Member
Mon 27 Jun 2016 07:27:25 PM UTC, comment #13: 

I commented there.

I still think Octave's configure should be defensive and filter out all options except those beginning with -I, I'll take a look at making that change.

Mike Miller <mtmiller>
Group Member
Mon 27 Jun 2016 06:47:56 PM UTC, comment #12: 

There are some comments/questions by RedHat people on necessity of
 @LARGEFILE@ and @PTHREAD_FLAGS@.

I have no idea, so I would appreciate if somebody can comment here or there.

https://bugzilla.redhat.com/show_bug.cgi?id=1350069

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Sat 25 Jun 2016 04:29:54 AM UTC, comment #11: 

Mike,
I copied your bug report to redhat:

https://bugzilla.redhat.com/show_bug.cgi?id=1350069

FYI.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 24 Jun 2016 07:34:32 PM UTC, comment #10: 

Yeah, I think people sometimes misunderstand that the pkg-config is for users of the package, not a record of what options were used to build the package...

John W. Eaton <jwe>
Group administrator
Fri 24 Jun 2016 07:07:07 PM UTC, comment #9: 

I've filed a bug against the Debian fltk1.3 package

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=828081

Mike Miller <mtmiller>
Group Member
Fri 24 Jun 2016 06:14:01 PM UTC, comment #8: 

On Debian:


$ fltk-config --use-gl --cflags | sed 's/ \+/ \\\n    /g'
 \
    -I/usr/include/cairo \
    -I/usr/include/glib-2.0 \
    -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
    -I/usr/include/pixman-1 \
    -I/usr/include/freetype2 \
    -I/usr/include/libpng16 \
    -I/usr/include/freetype2 \
    -DCP936 \
    -D_LARGEFILE_SOURCE \
    -D_LARGEFILE64_SOURCE \
    -D_THREAD_SAFE \
    -D_REENTRANT
$ fltk-config --use-gl --cxxflags | sed 's/ \+/ \\\n    /g'
 \
    -I/usr/include/cairo \
    -I/usr/include/glib-2.0 \
    -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
    -I/usr/include/pixman-1 \
    -I/usr/include/freetype2 \
    -I/usr/include/libpng16 \
    -I/usr/include/freetype2 \
    -I/usr/include/cairo \
    -I/usr/include/glib-2.0 \
    -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
    -I/usr/include/pixman-1 \
    -I/usr/include/freetype2 \
    -I/usr/include/libpng16 \
    -fvisibility-inlines-hidden \
    -D_LARGEFILE_SOURCE \
    -D_LARGEFILE64_SOURCE \
    -D_THREAD_SAFE \
    -D_REENTRANT
$ fltk-config --use-gl --cflags | sed 's/-[^I]\S*//g'
 -I/usr/include/cairo -I/usr/include/glib -I/usr/lib/x86_64 -I/usr/include/pixman -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2



Mike Miller <mtmiller>
Group Member
Fri 24 Jun 2016 06:10:31 PM UTC, comment #7: 

I do remember looking at fltk-config for some related issue or question recently. I remember thinking that maybe Octave should filter the output of fltk-config --cflags or --cxxflags and only use the -I options, ignore anything else with -D or -f or -specs.

IMHO those -D options should only be declared inside the library for building that library's modules, and not imposed on the API.

I agree this seems like a bug in fltk itself, the config program should be more conservative in what options it recommends users to apply.

Reopening for suggestions or patches. My suggestion would be to pipe the output through sed and only include words that start with "-I" in the FLTK_CPPFLAGS variable.

Mike Miller <mtmiller>
Group Member
Fri 24 Jun 2016 05:26:04 PM UTC, comment #6: 

What does
fltk-config-x86_64 --cxxflags

returns on Ubuntu / Debian ?

It is quite possible that thsi is a bug/fltk in fltk --
its config script inherits flags that were used to compile
fltk itself.

Perhaps octave should not use/rely on fltk-config to figure out
compiler flags, but I really do not understand configure magic
to make a constructive suggestion.

I just tried to reset FLTK_CONFIG and FLTK_CPPFLAGS to
empty strings and everything still works.
(-I/usr/include/freetype2 might be useful but we get it from elsewhere; I am not sure what are the possible problems due to not  defining all the constants:  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT)

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Fri 24 Jun 2016 10:40:41 AM UTC, comment #5: 

Right. Dmitri found exactly what happened to me.
Probably appropriate to place the blame on Fedora.

Michael Godfrey <godfrey>
Group Member
Fri 24 Jun 2016 05:49:58 AM UTC, comment #4: 

Thanks for investigating Dmitri. I agree, this looks like a Fedora packaging bug, with the fltk package I suppose? That option is probably for internal use when building fltk and shouldn't be exposed to the user like that. Closing as invalid since there's nothing Octave can do about this, but please do report this to the Fedora bug tracker.

Mike Miller <mtmiller>
Group Member
Fri 24 Jun 2016 05:35:55 AM UTC, comment #3: 

The problem is that you get 
fltk-config-x86_64 --cxxflags

-I/usr/include/freetype2 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT

But /usr/lib/rpm/redhat/redhat-hardened-cc1
is part of redhat-rpm-config.

It looks like a Fedora dependency bug.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 23 Jun 2016 11:06:45 PM UTC, comment #2: 

Yes, I am sure. Pretty simple to test: Use dnf to
remove it, run configure, observe that FLTK is disabled,
install it, run configure, observe that FLTK is
enabled and works after build.
And, here is the code in configure that fails:

$as_echo_n "checking for OpenGL support in FLTK... " >&6; }
if ${octave_cv_fltk_opengl_support+:} false; then :
  $as_echo_n "(cached) " >&6
else
  save_CPPFLAGS="$CPPFLAGS"
      CPPFLAGS="$CFLAGS $FLTK_CPPFLAGS"
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

        #include <FL/gl.h>

#ifdef F77_DUMMY_MAIN

#  ifdef __cplusplus
     extern "C"
#  endif
   int F77_DUMMY_MAIN() { return 1; }

#endif
int
main ()
{

        int nothing = 0;

  ;
  return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
  octave_cv_fltk_opengl_support=yes
else
  octave_cv_fltk_opengl_support=no
fi


Michael Godfrey <godfrey>
Group Member
Thu 23 Jun 2016 10:42:57 PM UTC, comment #1: 

Thanks, but I don't have enough information to do anything about this bug report.

Are you sure the rdhat-rpm-config package is responsible for your configure failure? If you uninstall only that package does it fail again? What is the exact error shown by configure?

There already are tests that Fortran works, both by itself and with the BLAS and LAPACK libraries, so I don't know how that's related.

Mike Miller <mtmiller>
Group Member
Thu 23 Jun 2016 03:45:19 PM UTC, original submission:  

The problem showed up as failure to build FLTK due to
missing GL/glext.h, but the real problem was that the
package redhat-rpm-config-40-2.fc24.noarch was missing.
This got removed in an overzealous cleanup after the update
from fc23 to fc24. This caused Fortran to fail at around line
20906 in configure.

Would a test that Fortran is working before trying to use it
be a good idea?

Michael Godfrey <godfrey>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by godfrey (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-27 mtmiller StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2016-06-24 mtmiller StatusInvalid / Not an Octave Bug Need Info
        Open/ClosedClosed Open
        SummaryUpdate to FC24 failed build due to lack of redhat-rpm-config-40-2.fc24.noarch configure: fltk-config leaks too many compiler options into FLTK_CPPFLAGS
    2016-06-24 mtmiller StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2016-06-23 mtmiller StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code