From: Eamon Walsh <ewalsh@tycho.nsa.gov>
To: Joshua Brindle <jbrindle@tresys.com>
Cc: SELinux List <selinux@tycho.nsa.gov>
Subject: Re: [PATCH] Add implicit lib requirements to LDLIBS
Date: Wed, 31 Mar 2010 11:34:42 -0400 [thread overview]
Message-ID: <4BB36B92.8010704@tycho.nsa.gov> (raw)
In-Reply-To: <4BB34C5C.7030309@tresys.com>
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
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
[-- Attachment #2: gtkhelloworld.c --]
[-- Type: text/plain, Size: 2102 bytes --]
#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;
}
prev parent reply other threads:[~2010-03-31 15:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-30 21:08 [PATCH] Add implicit lib requirements to LDLIBS Joshua Brindle
2010-03-30 23:34 ` Eamon Walsh
2010-03-31 13:21 ` Joshua Brindle
2010-03-31 15:15 ` Stephen Smalley
2010-03-31 15:17 ` Stephen Smalley
2010-03-31 15:33 ` Joshua Brindle
2010-03-31 15:34 ` Eamon Walsh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BB36B92.8010704@tycho.nsa.gov \
--to=ewalsh@tycho.nsa.gov \
--cc=jbrindle@tresys.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.