public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* How does one make a bash "builtin" (shared loadable module) on cygwin
@ 2011-05-18 22:47 Rocky Bernstein
  2011-05-19  1:24 ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 2+ messages in thread
From: Rocky Bernstein @ 2011-05-18 22:47 UTC (permalink / raw)
  To: cygwin

 I am trying to build a bash "builtin" (a dynamically loadable bash
module) on cygwin. Here's the error message I get via automake/make:
$ make
gcc  -g -O2   -o set0.exe -shared set0-set0.o
set0-set0.o: In function `set0_builtin':
/tmp/bashdb/builtin/set0.c:46: undefined reference to `_builtin_error'
/tmp/bashdb/builtin/set0.c:47: undefined reference to `_builtin_usage'
/tmp/bashdb/builtin/set0.c:51: undefined reference to `_dollar_vars'
/tmp/bashdb/builtin/set0.c:52: undefined reference to `_xmalloc'
/tmp/bashdb/builtin/set0.c:52: undefined reference to `_dollar_vars'
/tmp/bashdb/builtin/set0.c:42: undefined reference to `_builtin_error'
/tmp/bashdb/builtin/set0.c:43: undefined reference to `_builtin_usage'
collect2: ld returned 1 exit status
make: *** [set0.exe] Error 1
The complete Makefile.am and code is listed at
http://bashdb.git.sourceforge.net/git/gitweb.cgi?p=bashdb/bashdb;a=tree;f=builtin;h=428fd8f3598c88eabb10b3ba800fb900da9f858c;hb=HEAD

Perhaps I need to tell cygwin that these symbols are supposed to be
undefined since they are part of bash?
I've tried looking at gcc documentation for linker options but it's
all a mystery to me.
Thanks in advance for help, suggestions or links to documentation.
Regards,
   rocky

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How does one make a bash "builtin" (shared loadable module) on cygwin
  2011-05-18 22:47 How does one make a bash "builtin" (shared loadable module) on cygwin Rocky Bernstein
@ 2011-05-19  1:24 ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Hall (Cygwin) @ 2011-05-19  1:24 UTC (permalink / raw)
  To: cygwin

On 5/18/2011 6:47 PM, Rocky Bernstein wrote:
>   I am trying to build a bash "builtin" (a dynamically loadable bash
> module) on cygwin. Here's the error message I get via automake/make:
> $ make
> gcc  -g -O2   -o set0.exe -shared set0-set0.o
> set0-set0.o: In function `set0_builtin':
> /tmp/bashdb/builtin/set0.c:46: undefined reference to `_builtin_error'
> /tmp/bashdb/builtin/set0.c:47: undefined reference to `_builtin_usage'
> /tmp/bashdb/builtin/set0.c:51: undefined reference to `_dollar_vars'
> /tmp/bashdb/builtin/set0.c:52: undefined reference to `_xmalloc'
> /tmp/bashdb/builtin/set0.c:52: undefined reference to `_dollar_vars'
> /tmp/bashdb/builtin/set0.c:42: undefined reference to `_builtin_error'
> /tmp/bashdb/builtin/set0.c:43: undefined reference to `_builtin_usage'
> collect2: ld returned 1 exit status
> make: *** [set0.exe] Error 1
> The complete Makefile.am and code is listed at
> http://bashdb.git.sourceforge.net/git/gitweb.cgi?p=bashdb/bashdb;a=tree;f=builtin;h=428fd8f3598c88eabb10b3ba800fb900da9f858c;hb=HEAD
>
> Perhaps I need to tell cygwin that these symbols are supposed to be
> undefined since they are part of bash?

Close.  The Windows loader doesn't allow undefined symbols.  The mechanism
to simulate them is to use a library of "thunks" called an import library.
You link against the import library instead.

Since I don't know anything about how to create bash builtins, I don't know
if there's a facility for doing this with Cygwin (or native Windows for that
matter).  I suppose if not, you could always write your own thunks.  But
it's probably worth a google or two before investigating that path.


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-19  1:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 22:47 How does one make a bash "builtin" (shared loadable module) on cygwin Rocky Bernstein
2011-05-19  1:24 ` Larry Hall (Cygwin)

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).