Description of problem: When I leave off some of the -lXblah arguments, the dynamic linker manages to find everything OK, but depending on position, the program segfaults or otherwise doesn't work. When I fully specify the link order, it still sometimes doesn't work, if the order is wrong. I have found an order that always works, but there's still some strange position dependent bug. I haven't tried linking statically. Version-Release number of selected component (if applicable): I've tried this on two very different boxes, both x86, running FC4 that was completely up to date (yum update done prior to all tests, and xorg-x11 has had a few changes recently so I made sure I was getting the latest, as of 9/22). How reproducible: Very, but unpredictably, depending on link order. Steps to Reproduce: 1. Sample program below. 2. Compile and link; experiment with library order, like leave most of them off, or just try something like -lGLw -lGL -lXt -lX11 -lXm; some combinations work, some don't. I get segfaults, or invalid X requests, depending on how it links. Even re-running it can change what I get (different dynamic link order). Actual results: segfault Expected results: no segfault Additional info: #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <math.h> #include <X11/Intrinsic.h> static String fallbackResources[] = { NULL }; XtAppContext app = NULL; Widget toplevel = NULL; int main(int argc, char *argv[]) { toplevel = XtAppInitialize(&app, "moo", NULL, 0, &argc, argv, fallbackResources, NULL, 0); return 0; }
Created attachment 119156 [details] test program that fails
More information about the link order. We've tried this now on a total of 4 different boxes. The basic workaround is to move '-lXm' to the left of '-lGLw'. Apparently there are some functions with the same name in there someplace.
Your report is technical/developer support request rather than a bug report. The xorg.org mailing list is a more appropriate location to seek assistance for developing X applications. Setting status to NOTABUG.