zsh-workers
 help / color / mirror / code / Atom feed
* builtins.c does not compile under latest cygwin
@ 2013-08-02 19:14 Edgar Sánchez Grajeda
  2013-08-02 20:00 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Edgar Sánchez Grajeda @ 2013-08-02 19:14 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Hello,

When installing Cygwin I tried installing zsh from the source, and the
builtin.c module
​was not compiling.

Here
​​
the output from make:

rm -f libzsh-5.0.2.dll
gcc  -s -shared -Wl,--export-all-symbols -o libzsh-5.0.2.dll  `cat
stamp-modobjs` -ldl -lncursesw -lrt -lm  -lc
builtin.o:builtin.c:(.text+0xa98c): undefined reference to
`cygwin_conv_to_posix_path'
builtin.o:builtin.c:(.text+0xa98c): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `cygwin_conv_to_posix_path'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld:
builtin.o: bad reloc address 0x8 in section `.data'
collect2: error: ld returned 1 exit status
Makefile:230: recipe for target `libzsh-5.0.2.dll' failed
make[1]: *** [libzsh-5.0.2.dll] Error 1
make[1]: Leaving directory `/zsh-5.0.2/Src'

I
​ looked up the missing function, and cygwin_conv_to_posix_path() function
was deprecated and replaced with cygwin_conv_path().

In builtins.c:cd_do_chdir()​

​I fixed it with:

#ifndef _SYS_CYGWIN_H
    void cygwin_conv_path(cygwin_conv_path_t what, const void * from, void
* to, size_t size);
#endif

    cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, dest, buf,
PATH_MAX);​


​   dest = buf;​


​There's still some comptests failing when running make check, but at least
now it's compiling without errors​.

--
~ Ed
​gar​

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

* Re: builtins.c does not compile under latest cygwin
  2013-08-02 19:14 builtins.c does not compile under latest cygwin Edgar Sánchez Grajeda
@ 2013-08-02 20:00 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2013-08-02 20:00 UTC (permalink / raw)
  To: zsh-workers

On Fri, 2 Aug 2013 14:14:26 -0500
Edgar Sánchez Grajeda <edgarsanchezg@gmail.com> wrote:
> I looked up the missing function, and cygwin_conv_to_posix_path() function
> was deprecated and replaced with cygwin_conv_path().

You probably need something like this.

There doesn't seem any point in trying to fix things up if the header
isn't present in this case since the definitions won't be available.

diff --git a/Src/builtin.c b/Src/builtin.c
index ae2e9f6..3159975 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -939,11 +939,16 @@ cd_do_chdir(char *cnam, char *dest, int hard)
      * DOS style names with drives in them
      */
     static char buf[PATH_MAX];
+#ifdef HAVE_CYGWIN_CONV_PATH
+    cygwin_conv_path(CCP_WIN_A_TO_POSIX | CCP_RELATIVE, dest, buf,
+		     PATH_MAX);
+#else
 #ifndef _SYS_CYGWIN_H
     void cygwin_conv_to_posix_path(const char *, char *);
 #endif
 
     cygwin_conv_to_posix_path(dest, buf);
+#endif
     dest = buf;
 #endif
     nocdpath = dest[0] == '.' &&
diff --git a/configure.ac b/configure.ac
index 5528597..c3debd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1237,7 +1237,8 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
 	       regcomp regexec regerror regfree \
 	       gdbm_open getxattr \
 	       realpath canonicalize_file_name \
-	       symlink getcwd)
+	       symlink getcwd \
+	       cygwin_conv_path)
 AC_FUNC_STRCOLL
 
 if test x$enable_cap = xyes; then

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

end of thread, other threads:[~2013-08-02 20:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02 19:14 builtins.c does not compile under latest cygwin Edgar Sánchez Grajeda
2013-08-02 20:00 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).