* Re: binutils 2.5.2l.10 is released.
[not found] <9505012011.AA14501@gnu.mc.xerox.com>
@ 1995-05-01 13:29 ` H.J. Lu
1995-05-01 13:45 ` Marty Leisner
0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 1995-05-01 13:29 UTC (permalink / raw)
To: Marty Leisner; +Cc: Ken Raeburn, gas2
>
> > I don't remember that. I understand -static will turn off the lib*.so*
> > search.
> >
> > --
> > H.J. Lu
> > NYNEX Science and Technology, Inc. hjl@nynexst.com
>
>
> I never got around to implementing this behavior in gcc (I complained
> about it for years...)
>
> On Sun, the linker allows you to do:
>
> ld *.o -lfoo1 -Bstatic -lfoo2 -Bdynamic -lfoo3
>
> (essentially specially which libraries to link statically).
>
> In order to get the same behavior, you need to do:
> ld *.o -lfoo1 /usr/lib/libfoo.a -lfoo3
> with gcc/ld
>
I will implement it if noone does and I have the time. First we
have to agree on what syntax to use. -Bstatic/-Bdynamic or
-static/-dynamic?
--
H.J. Lu
NYNEX Science and Technology, Inc. hjl@nynexst.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: binutils 2.5.2l.10 is released.
1995-05-01 13:29 ` binutils 2.5.2l.10 is released H.J. Lu
@ 1995-05-01 13:45 ` Marty Leisner
1995-05-02 0:05 ` -static -lfoo -dynamic -lbar H.J. Lu
0 siblings, 1 reply; 5+ messages in thread
From: Marty Leisner @ 1995-05-01 13:45 UTC (permalink / raw)
To: H.J. Lu; +Cc: Ken Raeburn, gas2
>>
>
>I will implement it if noone does and I have the time. First we
>have to agree on what syntax to use. -Bstatic/-Bdynamic or
>-static/-dynamic?
>
>
>--
>H.J. Lu
>NYNEX Science and Technology, Inc. hjl@nynexst.com
Thanks...if you understand how gcc is organized (I looked at this
in 1.x and saw it was a lot to understand).
This should be trivial...Use -static/-dynamic [does gnu ld understand
this?]
(its not trivial to even see if ld works this way ;-( )
Doing this is a big win.
marty
^ permalink raw reply [flat|nested] 5+ messages in thread
* -static -lfoo -dynamic -lbar
1995-05-01 13:45 ` Marty Leisner
@ 1995-05-02 0:05 ` H.J. Lu
1995-05-02 10:27 ` Mike Meissner
0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 1995-05-02 0:05 UTC (permalink / raw)
To: Marty Leisner; +Cc: gas2, Ken Raeburn
>
>
> >>
> >
> >I will implement it if noone does and I have the time. First we
> >have to agree on what syntax to use. -Bstatic/-Bdynamic or
> >-static/-dynamic?
> >
> >
> >--
> >H.J. Lu
> >NYNEX Science and Technology, Inc. hjl@nynexst.com
>
> Thanks...if you understand how gcc is organized (I looked at this
> in 1.x and saw it was a lot to understand).
>
gcc/gnu getopt liks to reorder options and I cannot use -dynamic
nor -Bxxxxx. You have to use -Wl,-xxxxxx for the time being.
> This should be trivial...Use -static/-dynamic [does gnu ld understand
> this?]
>
No. Use -Bstatic/-Bdynamic.
> (its not trivial to even see if ld works this way ;-( )
>
Try this one on top of binutils 2.5.2l.11. I have included this
in binutils 2.5.2l.12. You have to use:
# gcc -v foo.o -Wl,-Bstatic -lm -Wl,-Bdynamic
Please let me know if it works for you. BTW, it may work with
the current snapshot.
--
H.J. Lu
NYNEX Science and Technology, Inc. hjl@nynexst.com
----
RCS file: /home/cvs/gnu/binutils/ld/ldfile.c,v
retrieving revision 1.5
diff -c -r1.5 ldfile.c
*** 1.5 1995/04/27 03:24:16
--- ldfile.c 1995/05/02 06:45:45
***************
*** 183,189 ****
arch != (search_arch_type *) NULL;
arch = arch->next)
{
! if (config.dynamic_link)
{
if (ldemul_open_dynamic_archive (arch->name, entry))
return;
--- 183,189 ----
arch != (search_arch_type *) NULL;
arch = arch->next)
{
! if (entry->dynamic_link)
{
if (ldemul_open_dynamic_archive (arch->name, entry))
return;
===================================================================
RCS file: /home/cvs/gnu/binutils/ld/ldlang.h,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ldlang.h
*** 1.1.1.2 1995/02/22 02:02:31
--- ldlang.h 1995/05/02 06:45:45
***************
*** 229,234 ****
--- 229,237 ----
asection *common_section;
asection *common_output_section;
boolean complained;
+
+ /* This is used to overwrite the global one. */
+ boolean dynamic_link;
} lang_input_statement_type;
typedef struct
===================================================================
RCS file: /home/cvs/gnu/binutils/ld/lexsup.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 lexsup.c
*** 1.1.1.3 1995/03/24 02:20:43
--- lexsup.c 1995/05/02 06:45:45
***************
*** 53,58 ****
--- 53,62 ----
{
int ingroup = 0;
+ int use_last_link_config = 0;
+ boolean last_is_dynamic_link;
+ lang_input_statement_type * library;
+
/* Starting the short option string with '-' is for programs that
expect options and other ARGV-elements in any order and that care about
the ordering of the two. We describe each non-option ARGV-element
***************
*** 193,201 ****
--- 197,209 ----
break;
case OPTION_CALL_SHARED:
config.dynamic_link = true;
+ use_last_link_config = 1;
+ last_is_dynamic_link = true;
break;
case OPTION_NON_SHARED:
config.dynamic_link = false;
+ use_last_link_config = 1;
+ last_is_dynamic_link = false;
break;
case 'd':
command_line.force_common_definition = true;
***************
*** 245,252 ****
ldfile_add_library_path (optarg, true);
break;
case 'l':
! lang_add_input_file (optarg, lang_input_file_is_l_enum,
! (char *) NULL);
break;
case 'M':
config.map_filename = "-";
--- 253,263 ----
ldfile_add_library_path (optarg, true);
break;
case 'l':
! library = lang_add_input_file (optarg,
! lang_input_file_is_l_enum,
! (char *) NULL);
! library->dynamic_link = use_last_link_config ?
! last_is_dynamic_link : config.dynamic_link;
break;
case 'M':
config.map_filename = "-";
^ permalink raw reply [flat|nested] 5+ messages in thread
* -static -lfoo -dynamic -lbar
1995-05-02 0:05 ` -static -lfoo -dynamic -lbar H.J. Lu
@ 1995-05-02 10:27 ` Mike Meissner
1995-05-02 10:57 ` H.J. Lu
0 siblings, 1 reply; 5+ messages in thread
From: Mike Meissner @ 1995-05-02 10:27 UTC (permalink / raw)
To: hjl; +Cc: leisner, gas2, raeburn
| No. Use -Bstatic/-Bdynamic.
Except that GCC uses -B for other purposes.
--
Michael Meissner, Cygnus Support (East Coast)
Suite 105, 48 Grove Street, Somerville, MA 02144, USA
meissner@cygnus.com, 617-629-3016 (office), 617-629-3010 (fax)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: -static -lfoo -dynamic -lbar
1995-05-02 10:27 ` Mike Meissner
@ 1995-05-02 10:57 ` H.J. Lu
0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 1995-05-02 10:57 UTC (permalink / raw)
To: Mike Meissner; +Cc: leisner, gas2, Ken Raeburn
>
> | No. Use -Bstatic/-Bdynamic.
>
> Except that GCC uses -B for other purposes.
And gcc may reorder flags. That is why I said -Wl,xxxxxx.
>
BTW, one should not make changes at 2:00am in the morning. I will
make a new simpler patch when I get home today.
--
H.J. Lu
NYNEX Science and Technology, Inc. hjl@nynexst.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1995-05-02 10:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <9505012011.AA14501@gnu.mc.xerox.com>
1995-05-01 13:29 ` binutils 2.5.2l.10 is released H.J. Lu
1995-05-01 13:45 ` Marty Leisner
1995-05-02 0:05 ` -static -lfoo -dynamic -lbar H.J. Lu
1995-05-02 10:27 ` Mike Meissner
1995-05-02 10:57 ` H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).