Article delegate-en/5068 of [1-5169] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A5061@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] Re: Can not make from source : undefined reference to `forkpty' (Solution found)
31 May 2014 13:05:08 GMT feedback@delegate.org (Yutaka Sato)
The DeleGate Project


Hi,

 |After a deeper googleing, and spent more time on this issue, I've found
 |a fix for this.

The patch you showed is not a solution but a workaround.
It simply makes the compilation of "_-forkpty.c" fail because
of inavailability of the header file "<util.h>" on Ubuntu.

 $ ls -l /usr/include/util.h
 ls: cannot access /usr/include/util.h: No such file or directory

Because of it, "_-forkpty.o" is not created, and then DeleGate
fallbacks to "forkpty.o" which is to cope with platforms without
the capability of forkpty().
The header file is not necessary in "_-forkpty.c" on Ubuntu becase
"<pty.h>" defines forkpty().

Fortunately, the only functionality of DeleGate using forkpty() is
"yysh", which is the remote shell by DeleGate not used so widely :p
Thus the workaround works for almost everyone.
Moreover, any modification to the "_-forkpty.c" which lets it be in
a compilation error does work.

 |>> It seems that it have -lutil in arg but still not working.

It is strange because I'm doing the development of DeleGate
on Ubuntu since the last year, and the problem was fixed in
DeleGate/9.9.8-pre22 in the environment.

 $ gcc -v
 gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

If still you are able to reproduce the error, I must fix it in
the current version, for "yysh":p.

--
Yutaka Sato
from Japan

In message <_A5061@delegate-en.ML_> on 05/03/14(23:31:48)
you feedback@ml.delegate.org wrote:
 |The problem was solved already.
 |
 |After a deeper googleing, and spent more time on this issue, I've found
 |a fix for this.
 |
 |I don't actually know how it actually fixed through, but seems that some
 |other Ubuntu user are experiencing a similar problem.
 |
 |Thank you! delegate works great!
 |
 |diff --git a/maker/_-forkpty.c.orig b/maker/_-forkpty.c
 |index 6d82b86..b29abaa 100644
 |--- a/maker/_-forkpty.c.orig
 |+++ b/maker/_-forkpty.c
 |@@ -2,6 +2,7 @@
 | #include <stdio.h>
 | #include <pty.h>
 | #include <utmp.h>
 |+#include <util.h>
 | int _ForkptyX(int *pty,char *name,void *mode,void *size){
 |        int pid;
 |        pid = forkpty(pty,name,(struct termios*)mode,(struct winsize*)size);
 |
 |
 |On 05/00/0000 00:01 PM, Yutaka Sato DG wrote:
 |> Hi,
 |> 
 |> I uploaded DeleGate/9.9.8-pre23 as "
 |> ftp://ftp.delegate.org/pub/DeleGate/delegate9.9.8-pre23.tar.gz".  Please
 |> try it.
 |> 
 |> Yutaka
 |> 
 |> 
 |> 
 |> 2014-05-01 14:03 GMT+09:00 XiaokangWang <pymjqbdyi-7pkjwocpwjfr.ml@ml.delegate.org>:
 |> 
 |>> It seems that it have -lutil in arg but still not working.
 |>>
 |>>
 |>> $make
 |>> rm srcsign.o
 |>> sh make-init.sh
 |>> rm: cannot remove 〓maker/.cksum.p2lla.c〓: No such file or directory
 |>> rm: cannot remove 〓maker/.cksum.p2llb.c〓: No such file or directory
 |>> rm: cannot remove 〓src/builtin/icons/ysato/frog9*ico〓: No such file or
 |>> directory
 |>>
 |>> ####### -makeat: /media/xiaokangwang/KKData/install/delegate9.9.7/src
 |>> @shelikhoo-PC
 |>> make[1]: Entering directory
 |>> `/media/xiaokangwang/KKData/install/delegate9.9.7/src'
 |>> make[2]: Entering directory
 |>> `/media/xiaokangwang/KKData/install/delegate9.9.7/src'
 |>> cc -O2 -x c++ -DQS  -I../gen -I../include  -c version.c \
 |>>                         -DLICENSEE=\"""\"
 |>> cc -O2 -x c++ -DQS  -I../gen -I../include  -c ../srcsign.c -o ../srcsign..o
 |>> [/media/xiaokangwang/KKData/install/delegate9.9.7/src]cksum(../srcsign.c)
 |>> cc -O2 -x c++ -DQS  -I../gen -I../include  -c conf.c \
 |>>                         -DADMIN=\"pymjqbdyi-7pkjwocpwjfr.ml@ml.delegate.org\" \
 |>>                         -DADMINPASS=\"\"
 |>> conf.c: In function 〓int tryDGROOT(int*, int, int, const char*, const
 |>> char*, const char*, const char*)〓:
 |>> conf.c:516:16: warning: ignoring return value of 〓int seteuid(__uid_t)〓,
 |>> declared with attribute warn_unused_result [-Wunused-result]
 |>>     seteuid(uid);
 |>>                 ^
 |>> conf.c:518:14: warning: ignoring return value of 〓int seteuid(__uid_t)〓,
 |>> declared with attribute warn_unused_result [-Wunused-result]
 |>>     seteuid(0);
 |>>               ^
 |>> rm -f ../lib/libdelegate.a
 |>> ar cr ../lib/libdelegate.a version.o ../srcsign.o editconf.o admin.o
 |>> notify.o shutter.o abort.o form2conf.o process.o vaddr.o conf.o svport.o
 |>> ddi.o textconv.o script.o param.o env.o thmain.o syslog.o log.o svstat.o
 |>> iotimeout.o misc.o msg.o yshell.o shio.o db.o hostlist.o cond.o
 |>> service.o svconf.o filter.o master.o qstest.o delegate.o caps.o
 |>> spinach.o stls.o tsp.o sudo.o gacl.o access.o ident.o dgauth.o dgsign.o
 |>> ccache.o cache.o distrib.o bcounter.o ipno.o inets.o uns.o rident.o
 |>> inetd.o thruwayd.o dget.o urlfind.o mount.o url.o gopher.o icp.o icap.o
 |>> http.o httpx.o httplog.o httphead.o httpd.o cgi.o ssi.o htaccept.o
 |>> htccx.o htswitch.o htmlgen.o nntp.o nntplist.o nntpgw.o enews.o pop.o
 |>> smtp.o telnet.o ftp.o xferlog.o X.o wais.o whois.o imap.o ldap.o
 |>> smtpgate.o alias.o domain.o lpr.o sftp.o socks.o socks4.o sox.o
 |>> cuseeme.o coupler.o vsap.o tcprelay.o udprelay.o ftpgw.o filetype.o
 |>> /usr/bin/ranlib ../lib/libdelegate.a
 |>> "/media/xiaokangwang/KKData/install/delegate9.9.7/mkmake.exe" -touch
 |>> "../lib/libdelegate.a"
 |>> cc  -L../lib -o embed embed.o version.o ../srcsign.o \
 |>>                         ../lib/library.a ../lib/libcfi.a
 |>> ../lib/libmimekit.a ../lib/libmd5.a \
 |>>                         -lnsl -ldl -lutil -lpthread -lpam -lstdc++ -lc
 |>> ../lib/libsubst.a
 |>> ../lib/libsubst.a(_-forkpty.o): In function `_ForkptyX(int*, char*,
 |>> void*, void*)':
 |>> _-forkpty.c:(.text+0x1): undefined reference to `forkpty'
 |>> ../lib/libsubst.a(_-forkpty.o): In function `_Forkpty(int*, char*)':
 |>> _-forkpty.c:(.text+0x15): undefined reference to `forkpty'
 |>> collect2: error: ld returned 1 exit status
 |>> make[2]: *** [embed] Error 1
 |>> make[2]: Leaving directory
 |>> `/media/xiaokangwang/KKData/install/delegate9.9.7/src'
 |>> make[1]: *** [start0] Error 2
 |>> make[1]: Leaving directory
 |>> `/media/xiaokangwang/KKData/install/delegate9.9.7/src'
 |>> mkmake: ERROR LOG is left at
 |>> /media/xiaokangwang/KKData/install/delegate9.9.7/src/mkmake.err
 |>> mkmake: ERROR LOG is left at
 |>> /media/xiaokangwang/KKData/install/delegate9.9.7/src/mkmake.err
 |>> make: *** [all] Error 2
 |>>
 |> 

Cheers,
Yutaka
--
  9 9   Yutaka Sato (CSDP,ITIL-F,OCUP-A,Security+,ISTQB-F)
 ( ~ )  National Institute of Advanced Industrial Science and Technology
_<   >_ 1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan
Do the more with the less -- B. Fuller



  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V