Re: [PATCH] Add implicit lib requirements to LDLIBS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/31/2010 09:21 AM, Joshua Brindle wrote:
> Eamon Walsh wrote:
>   
>> On 03/30/2010 05:08 PM, Joshua Brindle wrote:
>>     
>>> Fedora 13 changed their linker behavior to not link indirect libraries.
>>> See information at: http://fedoraproject.org/wiki/UnderstandingDSOLinkChange
>>>
>>>       
>> I skimmed over semodule.c and setsebool.c and I didn't see any
>> references to bzip2 or ustr symbols.  My reading of the article suggests
>> the below fix should only be needed if that were the case.  Most likely
>> I missed them?
>>
>>     
> The link above is confusing. The change was made so that people who 
> _did_ use eg., libxml but didn't explicitly link against it would have 
> to do so even if other libraries they link against already did.
>
> In our case it means that anything libsemanage needs semodule and 
> setsebool will also need to link against explicitly.
>   

I'm still not seeing that anywhere in the discussion.  As far as I can
see, libraries are still supposed to pull in their own dependencies. 
Putting -lustr -lbz2 on the program build line should only be necessary
if the program source itself uses them, which semodule doesn't seem to. 
I think something's fishy in our build.

Take the following gtk2 program (attached).  I can successfully build
and run this program on rawhide just by linking with gtk2, even though
gtk2 has a ton of other libraries that it needs:

# gcc -I /usr/include/atk-1.0 -I /usr/include/pango-1.0 -I
/usr/include/cairo -I /usr/include/gtk-2.0 -I /usr/lib/gtk-2.0/include
-I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -o gtkhelloworld
gtkhelloworld.c -lgtk-x11-2.0
#




-- 

Eamon Walsh 
National Security Agency

#include <stdio.h>
#include <gtk/gtk.h>

/* This is a callback function. The data arguments are ignored
 * in this example. More on callbacks below. */
static void hello( GtkWidget *widget,
                   gpointer   data )
{
    printf ("Hello World\n");
}

static gboolean delete_event( GtkWidget *widget,
                              GdkEvent  *event,
                              gpointer   data )
{
    /* If you return FALSE in the "delete_event" signal handler,
     * GTK will emit the "destroy" signal. Returning TRUE means
     * you don't want the window to be destroyed.
     * This is useful for popping up 'are you sure you want to quit?'
     * type dialogs. */

    printf ("delete event occurred\n");

    /* Change TRUE to FALSE and the main window will be destroyed with
     * a "delete_event". */

    return TRUE;
}

/* Another callback */
static void destroy( GtkWidget *widget,
                     gpointer   data )
{
    gtk_main_quit ();
}

int main( int   argc,
          char *argv[] )
{
    /* GtkWidget is the storage type for widgets */
    GtkWidget *window;
    GtkWidget *button;
    
    /* This is called in all GTK applications. Arguments are parsed
     * from the command line and are returned to the application. */
    gtk_init (&argc, &argv);
    
    /* create a new window */
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    
    /* Sets the border width of the window. */
    gtk_container_set_border_width ((GtkContainer *)window, 10);
    
    /* Creates a new button with the label "Hello World". */
    button = gtk_button_new_with_label ("Hello World");
    
    /* This packs the button into the window (a gtk container). */
    gtk_container_add ((GtkContainer *)window, button);
    
    /* The final step is to display this newly created widget. */
    gtk_widget_show (button);
    
    /* and the window */
    gtk_widget_show (window);
    
    /* All GTK applications must have a gtk_main(). Control ends here
     * and waits for an event to occur (like a key press or
     * mouse event). */
    gtk_main ();
    
    return 0;
}

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux