Backend issues on NetBSD

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Backend issues on NetBSD

Riccardo Mottola-5
Hi,

I just rebuilt gnustep-back on NetBSD 6.1.5 x86 and clang where it
builds, but then fails tu load/run with:

2018-02-18 17:48:19.355 Ink[22510:3099672676] NSApplication.m:317  
Assertion failed in BOOL initialize_gnustep_backend().  Can't load
object file from backend at path
/System/Library/Bundles/libgnustep-back-026.bundle
Ink: Uncaught exception NSInternalInconsistencyException, reason:
NSApplication.m:317  Assertion failed in BOOL
initialize_gnustep_backend().  Can't load object file from backend at
path /System/Library/Bundles/libgnustep-back-026.bundle

The last time i checked this setup, it worked. It is a slightly older
NetBSd than I generally use but it uses clang instead of gcc

Relevant sections in the configure log seem also fine to me, pkgconfig
gets detected and the config output is below.
Cairo is detected, not freetype, so it gets switched to xlib, but still
I guess it should work

checking for XcursorImageCreate in -lXcursor... yes

Xcursor is explicitely found!


An issue might be:
configure:3954: checking whether -R must be followed by a space
configure:3970: clang -o conftest -g -O2  -I/System/Library/Headers
-I/usr/pkg/include  -L/System/Library/Libraries/gnu-gnu-gnu
-L/System/Library/Libraries -Wl,-R/usr/pkg/lib -L/usr/pkg/lib
conftest.c  -R/usr/X11R7/lib >&5
clang: warning: argument unused during compilation: '-R/usr/X11R7/lib'

what would be this -R/usr/X11R7/lib ? Shouldn't it always be
-Wl,-R/usr/X11R7/lib ??

The xlib backend should build just fine.
I got around the linking issue by adding LDFLAGS="-Wl,-R/usr/X11R7/lib
-L/usr/X11R7/lib" however then no Fonts gets displayed! It may be the
same issue that Cairo has: wrong library.

Further question is: why doesn't the cairo backend work out? This is the
failing test:

configure:5300: checking ft2build.h usability
configure:5300: clang -c -g -O2  -I/usr/X11R7/include  
-I/System/Library/Headers
  -I/usr/pkg/include -I/usr/pkg/include/freetype2  conftest.c >&5
In file included from conftest.c:62:
/usr/X11R7/include/ft2build.h:34:10: fatal error:
'freetype/config/ftheader.h' f
ile not found
#include <freetype/config/ftheader.h>

I have both a freetype package as a system freetype I guess the "order"
is frong, since the system path is before pkg, it gets detected.
pkg-config is returning the flags for the pkg one and not the system
one, but then the tests finds the system one and fails. I think
somewhere we append these flags instead of prepending them!

I found this in our configure.ac

   GRAPHIC_CFLAGS="$X_CFLAGS $GRAPHIC_CFLAGS"
   CPPFLAGS="$X_CFLAGS $CPPFLAGS"
   # Note: Don't include $X_LIBS in LDFLAGS as it may conflict with
   # other libraries installed in /sw, /sw/lib/freetyp2/lib
   #GRAPHIC_LFLAGS="$X_LIBS $GRAPHIC_LFLAGS"
   # But do include it here just to find the extra x libraries
   LDFLAGS="$X_LIBS $LDFLAGS"
   LIBS="-lX11 $X_EXTRA_LIBS $LIBS"

First, note that there is a comment... and then we exactly to what the
comment says not to do! Since freetype is excactly the library I am
having an issue with....
Both LDFLAGS and CPPFLAGS are appended and not prepended, I did change that.

Then I think also this needs to be fixed:
     CPPFLAGS="${FREETYPE_CFLAGS} ${CPPFLAGS}"

This finally worked for cairo (did not recheck if xlib works though). I
acclude the configure patch. I did not commit it yet and am open for
discussion, might this cause unforseen other issues?
What do you guys thik?
And the note about X_LIBS that somebody added?

Riccardo

narsil: {9} ./configure
checking build system type... i386-unknown-netbsdelf6.1
checking host system type... i386-unknown-netbsdelf6.1
checking target system type... i386-unknown-netbsdelf6.1
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for syslog... yes
checking for X... libraries /usr/X11R7/lib, headers /usr/X11R7/include
checking whether -R must be followed by a space... neither works
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for pkg-config... /usr/pkg/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for main in -lXext... yes
checking for main in -lXt... yes
checking for main in -lXmu... yes
checking for XFixesSelectSelectionInput in -lXfixes... yes
checking for XcursorImageCreate in -lXcursor... yes
checking for X11/extensions/shape.h... yes
checking for XShapeCombineMask in -lXext... yes
checking for X11/extensions/sync.h... yes
checking for X11 function prototypes... yes
checking DPS/dpsclient.h usability... no
checking DPS/dpsclient.h presence... no
checking for DPS/dpsclient.h... no
checking DPS/dpsNXargs.h usability... no
checking DPS/dpsNXargs.h presence... no
checking for DPS/dpsNXargs.h... no
checking for freetype2... yes
checking ft2build.h usability... no
checking ft2build.h presence... no
checking for ft2build.h... no
checking for xft... yes
checking for XftDrawStringUtf8 in -lXft... yes
checking for XftPatternGetString in -lXft... no
checking for Xutf8LookupString... yes
checking for FcPatternCreate in -lfontconfig... yes
checking fontconfig/fontconfig.h usability... yes
checking fontconfig/fontconfig.h presence... yes
checking for fontconfig/fontconfig.h... yes
checking for glXMakeContextCurrent in -lGL... yes
checking GL/glx.h usability... yes
checking GL/glx.h presence... yes
checking for GL/glx.h... yes
checking for GLX_RGBA_TYPE... yes
checking for usleep... yes
checking for X11/extensions/XShm.h... yes
checking for shmctl... yes
checking for XInternAtoms in -lX11... yes
checking for main in -lgdi32... no
checking for main in -lmsimg32... no
checking for main in -limm32... no
checking for main in -lopengl32... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for libart2... none
checking for main in -lart_lgpl_2... no
checking for cairo... yes
checking for cairo-ft... yes
checking for cairo-xlib... yes
checking for cairo-win32... no
checking for cairo-glitz... no
checking for fontconfig... yes
checking for cairo_win32_surface_create in -lcairo... no
checking for XRenderFindVisualFormat in -lXrender... yes
checking Backend Server... x11
checking Backend Graphics... cairo
configure: WARNING: can't find freetype, required for graphics=cairo
configure: Switching to xlib
checking whether the compiler supports -Wdeclaration-after-statement... yes
checking Backend name... back
configure: creating ./config.status
config.status: creating back.make
config.status: creating config.make
config.status: creating config.h
config.status: config.h is unchanged


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev

flags-configure.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Backend issues on NetBSD

Fred Kiefer


> Am 18.02.2018 um 19:19 schrieb Riccardo Mottola <[hidden email]>:
>
> I just rebuilt gnustep-back on NetBSD 6.1.5 x86 and clang where it builds, but then fails tu load/run with:
>
> 2018-02-18 17:48:19.355 Ink[22510:3099672676] NSApplication.m:317  Assertion failed in BOOL initialize_gnustep_backend().  Can't load object file from backend at path /System/Library/Bundles/libgnustep-back-026.bundle
> Ink: Uncaught exception NSInternalInconsistencyException, reason: NSApplication.m:317  Assertion failed in BOOL initialize_gnustep_backend().  Can't load object file from backend at path /System/Library/Bundles/libgnustep-back-026.bundle

I take it that this is with the cairo backend, as later you mention the xlib backend? Could you please be more clear about this as you are often using unusual setups and it is hard to tell which of these it is this time.

> The last time i checked this setup, it worked. It is a slightly older NetBSd than I generally use but it uses clang instead of gcc
>
> Relevant sections in the configure log seem also fine to me, pkgconfig gets detected and the config output is below.
> Cairo is detected, not freetype, so it gets switched to xlib, but still I guess it should work
>
> checking for XcursorImageCreate in -lXcursor... yes
>
> Xcursor is explicitely found!

Why do you think the issue is Xcursor related? Was there more output that hinted in this direction?
The most interesting information here would be the result of an ldd on /System/Library/Bundles/libgnustep-back-026.bundle. That way we would know which libraries are linked into the backend.


> An issue might be:
> configure:3954: checking whether -R must be followed by a space
> configure:3970: clang -o conftest -g -O2  -I/System/Library/Headers -I/usr/pkg/include  -L/System/Library/Libraries/gnu-gnu-gnu -L/System/Library/Libraries -Wl,-R/usr/pkg/lib -L/usr/pkg/lib conftest.c  -R/usr/X11R7/lib >&5
> clang: warning: argument unused during compilation: '-R/usr/X11R7/lib'
>
> what would be this -R/usr/X11R7/lib ? Shouldn't it always be -Wl,-R/usr/X11R7/lib ??

Could be that this check is wrong, but most likely it was never needed for clang anyway.


> The xlib backend should build just fine.
> I got around the linking issue by adding LDFLAGS="-Wl,-R/usr/X11R7/lib -L/usr/X11R7/lib" however then no Fonts gets displayed! It may be the same issue that Cairo has: wrong library.

Now you are talking about a backend that starts up, but doesn’t display fonts. But are the following lines from the configure output for cairo or xlib? The actual output should be similar in both cases.
And the lib backend should fall back to some other font system if freetype isn’t available. There should always be a way to display strings for this backend. On the other hand the cairo backend should not build at all without freetype and fall back to xlib. I am a bit confused what happened here.

> Further question is: why doesn't the cairo backend work out? This is the failing test:
>
> configure:5300: checking ft2build.h usability
> configure:5300: clang -c -g -O2  -I/usr/X11R7/include  -I/System/Library/Headers
> -I/usr/pkg/include -I/usr/pkg/include/freetype2  conftest.c >&5
> In file included from conftest.c:62:
> /usr/X11R7/include/ft2build.h:34:10: fatal error: 'freetype/config/ftheader.h' f
> ile not found
> #include <freetype/config/ftheader.h>
>
> I have both a freetype package as a system freetype I guess the "order" is frong, since the system path is before pkg, it gets detected. pkg-config is returning the flags for the pkg one and not the system one, but then the tests finds the system one and fails. I think somewhere we append these flags instead of prepending them!

Why do you have this library installed twice? And do you have the headers also twice? Then this test shouldn’t fail. It rather looks like there aren’t any header files for freetype at all. Could you please check where these files are?
I think I understand now what is going on. You have a half installed freetype that comes with your X installation and this gets found before the properly installed one. The change you made below won’t help here. You rather should clean up your installation. Prepending the freetype paths, as you did in your final change, might be a valid workaround. This could be a change we should integrate into back.


> I found this in our configure.ac
>
>  GRAPHIC_CFLAGS="$X_CFLAGS $GRAPHIC_CFLAGS"
>  CPPFLAGS="$X_CFLAGS $CPPFLAGS"
>  # Note: Don't include $X_LIBS in LDFLAGS as it may conflict with
>  # other libraries installed in /sw, /sw/lib/freetyp2/lib
>  #GRAPHIC_LFLAGS="$X_LIBS $GRAPHIC_LFLAGS"
>  # But do include it here just to find the extra x libraries
>  LDFLAGS="$X_LIBS $LDFLAGS"
>  LIBS="-lX11 $X_EXTRA_LIBS $LIBS"
>
> First, note that there is a comment... and then we exactly to what the comment says not to do! Since freetype is excactly the library I am having an issue with....
> Both LDFLAGS and CPPFLAGS are appended and not prepended, I did change that.

Yes, the comment conflicts with the actual code. But are you really sure that this was your actual problem? Or would the change you mention below be sufficient?
And actually the X paths are prepended here and this is also what you are doing below the the freetype paths.

> Then I think also this needs to be fixed:
>    CPPFLAGS="${FREETYPE_CFLAGS} ${CPPFLAGS}“

Yes, this could be something that is needed to get the configure script working on broken systems.

> This finally worked for cairo (did not recheck if xlib works though). I acclude the configure patch. I did not commit it yet and am open for discussion, might this cause unforseen other issues?
> What do you guys thik?
> And the note about X_LIBS that somebody added?


>
> narsil: {9} ./configure
> checking build system type... i386-unknown-netbsdelf6.1
> checking host system type... i386-unknown-netbsdelf6.1
> checking target system type... i386-unknown-netbsdelf6.1
> checking for gcc... clang
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether clang accepts -g... yes
> checking for clang option to accept ISO C89... none needed
> checking how to run the C preprocessor... clang -E
> checking for grep that handles long lines and -e... /usr/bin/grep
> checking for egrep... /usr/bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking syslog.h usability... yes
> checking syslog.h presence... yes
> checking for syslog.h... yes
> checking for syslog... yes
> checking for X... libraries /usr/X11R7/lib, headers /usr/X11R7/include
> checking whether -R must be followed by a space... neither works
> checking for gethostbyname... yes
> checking for connect... yes
> checking for remove... yes
> checking for shmat... yes
> checking for IceConnectionNumber in -lICE... yes
> checking for pkg-config... /usr/pkg/bin/pkg-config
> checking pkg-config is at least version 0.9.0... yes
> checking for main in -lXext... yes
> checking for main in -lXt... yes
> checking for main in -lXmu... yes
> checking for XFixesSelectSelectionInput in -lXfixes... yes
> checking for XcursorImageCreate in -lXcursor... yes
> checking for X11/extensions/shape.h... yes
> checking for XShapeCombineMask in -lXext... yes
> checking for X11/extensions/sync.h... yes
> checking for X11 function prototypes... yes
> checking DPS/dpsclient.h usability... no
> checking DPS/dpsclient.h presence... no
> checking for DPS/dpsclient.h... no
> checking DPS/dpsNXargs.h usability... no
> checking DPS/dpsNXargs.h presence... no
> checking for DPS/dpsNXargs.h... no
> checking for freetype2... yes
> checking ft2build.h usability... no
> checking ft2build.h presence... no
> checking for ft2build.h... no
> checking for xft... yes
> checking for XftDrawStringUtf8 in -lXft... yes
> checking for XftPatternGetString in -lXft... no
> checking for Xutf8LookupString... yes
> checking for FcPatternCreate in -lfontconfig... yes
> checking fontconfig/fontconfig.h usability... yes
> checking fontconfig/fontconfig.h presence... yes
> checking for fontconfig/fontconfig.h... yes
> checking for glXMakeContextCurrent in -lGL... yes
> checking GL/glx.h usability... yes
> checking GL/glx.h presence... yes
> checking for GL/glx.h... yes
> checking for GLX_RGBA_TYPE... yes
> checking for usleep... yes
> checking for X11/extensions/XShm.h... yes
> checking for shmctl... yes
> checking for XInternAtoms in -lX11... yes
> checking for main in -lgdi32... no
> checking for main in -lmsimg32... no
> checking for main in -limm32... no
> checking for main in -lopengl32... no
> checking windows.h usability... no
> checking windows.h presence... no
> checking for windows.h... no
> checking for libart2... none
> checking for main in -lart_lgpl_2... no
> checking for cairo... yes
> checking for cairo-ft... yes
> checking for cairo-xlib... yes
> checking for cairo-win32... no
> checking for cairo-glitz... no
> checking for fontconfig... yes
> checking for cairo_win32_surface_create in -lcairo... no
> checking for XRenderFindVisualFormat in -lXrender... yes
> checking Backend Server... x11
> checking Backend Graphics... cairo
> configure: WARNING: can't find freetype, required for graphics=cairo
> configure: Switching to xlib
> checking whether the compiler supports -Wdeclaration-after-statement... yes
> checking Backend name... back
> configure: creating ./config.status
> config.status: creating back.make
> config.status: creating config.make
> config.status: creating config.h
> config.status: config.h is unchanged
>
> <flags-configure.patch>_______________________________________________
> Gnustep-dev mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/gnustep-dev


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev