From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18282 invoked by alias); 19 May 2011 01:24:31 -0000 Received: (qmail 18268 invoked by uid 22791); 19 May 2011 01:24:29 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from nm9-vm0.bullet.mail.sp2.yahoo.com (HELO nm9-vm0.bullet.mail.sp2.yahoo.com) (98.139.91.196) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 19 May 2011 01:24:13 +0000 Received: from [98.139.91.65] by nm9.bullet.mail.sp2.yahoo.com with NNFMP; 19 May 2011 01:24:12 -0000 Received: from [98.136.185.47] by tm5.bullet.mail.sp2.yahoo.com with NNFMP; 19 May 2011 01:24:12 -0000 Received: from [127.0.0.1] by smtp108.mail.gq1.yahoo.com with NNFMP; 19 May 2011 01:24:12 -0000 Received: from [192.168.1.231] (reply-to-list-only-lh@108.7.36.4 with plain) by smtp108.mail.gq1.yahoo.com with SMTP; 18 May 2011 18:24:12 -0700 PDT X-Yahoo-SMTP: Uu383n6swBCEN1G9up0WSnxbvN8fCPmk Message-ID: <4DD4713C.70001@cygwin.com> Date: Thu, 19 May 2011 01:24:00 -0000 From: "Larry Hall (Cygwin)" Reply-To: cygwin@cygwin.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Mnenhy/0.8.3 Thunderbird/3.1.10 ThunderBrowse/3.3.5 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: How does one make a bash "builtin" (shared loadable module) on cygwin References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-05/txt/msg00259.txt.bz2 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