zsh-5.9-clang-15-configure.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. https://bugs.gentoo.org/869539
  2. https://github.com/zsh-users/zsh/commit/ab4d62eb975a4c4c51dd35822665050e2ddc6918
  3. https://www.zsh.org/mla/workers/2022/msg00964.html
  4. --- a/configure.ac
  5. +++ b/configure.ac
  6. @@ -583,11 +583,11 @@ if test x$zsh_cv_c_have_union_init = xye
  7. fi
  8. dnl Checking if compiler correctly cast signed to unsigned.
  9. AC_CACHE_CHECK(if signed to unsigned casting is broken,
  10. zsh_cv_c_broken_signed_to_unsigned_casting,
  11. -[AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])])
  12. +[AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])])
  13. AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING],
  14. [Define to 1 if compiler incorrectly cast signed to unsigned.])
  15. if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then
  16. AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING)
  17. fi
  18. @@ -1044,21 +1044,21 @@ if test x$zsh_cv_long_is_64_bit = xyes;
  19. else
  20. AC_CACHE_CHECK(if off_t is 64 bit, zsh_cv_off_t_is_64_bit,
  21. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  22. #include <sys/types.h>
  23. -main() { return sizeof(off_t) < 8; }
  24. +int main() { return sizeof(off_t) < 8; }
  25. ]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])])
  26. if test x$zsh_cv_off_t_is_64_bit = xyes; then
  27. AC_DEFINE(OFF_T_IS_64_BIT)
  28. fi
  29. AC_CACHE_CHECK(if ino_t is 64 bit, zsh_cv_ino_t_is_64_bit,
  30. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  31. #include <sys/types.h>
  32. -main() { return sizeof(ino_t) < 8; }
  33. +int main() { return sizeof(ino_t) < 8; }
  34. ]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])])
  35. if test x$zsh_cv_ino_t_is_64_bit = xyes; then
  36. AC_DEFINE(INO_T_IS_64_BIT)
  37. fi
  38. @@ -1394,22 +1394,22 @@ zsh_cv_func_tgetent_accepts_null,
  39. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  40. #include <fcntl.h>
  41. #include <stdlib.h>
  42. int tgetent(char *, char *);
  43. char *tgetstr(char *, char **);
  44. -main()
  45. +int main()
  46. {
  47. char buf[4096];
  48. int r1 = tgetent(buf, "vt100");
  49. int r2 = tgetent((char*)0,"vt100");
  50. if (r1 >= 0 && r1 == r2) {
  51. char tbuf[1024], *u;
  52. u = tbuf;
  53. tgetstr("cl", &u);
  54. creat("conftest.tgetent", 0640);
  55. }
  56. - exit((r1 != r2) || r2 == -1);
  57. + return((r1 != r2) || r2 == -1);
  58. }
  59. ]])],[if test -f conftest.tgetent; then
  60. zsh_cv_func_tgetent_accepts_null=yes
  61. else
  62. zsh_cv_func_tgetent_accepts_null=no
  63. @@ -1422,22 +1422,22 @@ zsh_cv_func_tgetent_zero_success,
  64. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  65. #include <fcntl.h>
  66. #include <stdlib.h>
  67. int tgetent(char *, char*);
  68. char *tgetstr(char *, char **);
  69. -main()
  70. +int main()
  71. {
  72. char buf[4096];
  73. int r1 = tgetent(buf, "!@#$%^&*");
  74. int r2 = tgetent(buf, "vt100");
  75. if (r1 < 0 && r2 == 0) {
  76. char tbuf[1024], *u;
  77. u = tbuf;
  78. tgetstr("cl", &u);
  79. creat("conftest.tgetent0", 0640);
  80. }
  81. - exit(r1 == r2);
  82. + return(r1 == r2);
  83. }
  84. ]])],[if test -f conftest.tgetent0; then
  85. zsh_cv_func_tgetent_zero_success=yes
  86. else
  87. zsh_cv_func_tgetent_zero_success=no
  88. @@ -1860,27 +1860,27 @@ zsh_cv_rlim_t_is_longer,
  89. #ifdef HAVE_SYS_TIME_H
  90. #include <sys/time.h>
  91. #endif
  92. #include <sys/resource.h>
  93. #include <stdlib.h>
  94. -main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
  95. +int main(){struct rlimit r;return(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
  96. if test x$zsh_cv_rlim_t_is_longer = xyes; then
  97. AC_CACHE_CHECK(if rlim_t is a quad,
  98. zsh_cv_rlim_t_is_quad_t,
  99. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  100. #ifdef HAVE_SYS_TIME_H
  101. #include <sys/time.h>
  102. #endif
  103. #include <stdio.h>
  104. #include <sys/resource.h>
  105. #include <stdlib.h>
  106. -main() {
  107. +int main() {
  108. struct rlimit r;
  109. char buf[20];
  110. r.rlim_cur = 0;
  111. sprintf(buf, "%qd", r.rlim_cur);
  112. - exit(strcmp(buf, "0"));
  113. + return(strcmp(buf, "0"));
  114. }]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])])
  115. if test x$zsh_cv_rlim_t_is_quad_t = xyes; then
  116. AC_DEFINE(RLIM_T_IS_QUAD_T)
  117. DEFAULT_RLIM_T=quad_t
  118. else
  119. @@ -1894,11 +1894,11 @@ else
  120. #ifdef HAVE_SYS_TIME_H
  121. #include <sys/time.h>
  122. #endif
  123. #include <sys/resource.h>
  124. #include <stdlib.h>
  125. - main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
  126. + int main(){struct rlimit r;r.rlim_cur=-1;return(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
  127. if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then
  128. AC_DEFINE(RLIM_T_IS_UNSIGNED)
  129. DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T"
  130. fi
  131. fi
  132. @@ -2175,11 +2175,11 @@ zsh_cv_sys_fifo,
  133. #include <fcntl.h>
  134. #include <signal.h>
  135. #include <unistd.h>
  136. #include <stdlib.h>
  137. #include <sys/stat.h>
  138. -main()
  139. +int main()
  140. {
  141. char c;
  142. int fd;
  143. int pid, ret;
  144. unlink("/tmp/fifo$$");
  145. @@ -2189,19 +2189,19 @@ main()
  146. if(mknod("/tmp/fifo$$", 0010600, 0) < 0)
  147. #endif
  148. exit(1);
  149. pid = fork();
  150. if(pid < 0)
  151. - exit(1);
  152. + return(1);
  153. if(pid) {
  154. fd = open("/tmp/fifo$$", O_RDONLY);
  155. - exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
  156. + return(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
  157. }
  158. fd = open("/tmp/fifo$$", O_WRONLY);
  159. ret = (fd < 0 || write(fd, "x", 1) < 1);
  160. unlink("/tmp/fifo$$");
  161. - exit(ret);
  162. + return(ret);
  163. }
  164. ]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes])
  165. ])
  166. AH_TEMPLATE([HAVE_FIFOS],
  167. [Define to 1 if system has working FIFOs.])
  168. @@ -2276,24 +2276,24 @@ AC_CACHE_CHECK(if link() works,
  169. zsh_cv_sys_link,
  170. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  171. #include <unistd.h>
  172. #include <fcntl.h>
  173. #include <stdlib.h>
  174. -main()
  175. +int main()
  176. {
  177. int ret;
  178. char *tmpfile, *newfile;
  179. tmpfile="/tmp/zsh.linktest$$";
  180. newfile="/tmp/zsh.linktest2$$";
  181. unlink(tmpfile);
  182. unlink(newfile);
  183. if(creat(tmpfile, 0644) < 0)
  184. - exit(1);
  185. + return(1);
  186. ret = link(tmpfile, newfile);
  187. unlink(tmpfile);
  188. unlink(newfile);
  189. - exit(ret<0);
  190. + return(ret<0);
  191. }
  192. ]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])])
  193. AH_TEMPLATE([HAVE_LINK],
  194. [Define to 1 if system has working link().])
  195. if test x$zsh_cv_sys_link = xyes; then
  196. @@ -2309,15 +2309,15 @@ zsh_cv_sys_killesrch,
  197. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  198. #include <unistd.h>
  199. #include <signal.h>
  200. #include <errno.h>
  201. #include <stdlib.h>
  202. -main()
  203. +int main()
  204. {
  205. int pid = (getpid() + 10000) & 0xffffff;
  206. while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1;
  207. - exit(errno!=ESRCH);
  208. + return(errno!=ESRCH);
  209. }
  210. ]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])])
  211. AH_TEMPLATE([BROKEN_KILL_ESRCH],
  212. [Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51.])
  213. if test x$zsh_cv_sys_killesrch = xno; then
  214. @@ -2339,11 +2339,11 @@ if test x$signals_style = xPOSIX_SIGNALS
  215. #include <stdlib.h>
  216. int child=0;
  217. void handler(sig)
  218. int sig;
  219. {if(sig==SIGCHLD) child=1;}
  220. -main() {
  221. +int main() {
  222. struct sigaction act;
  223. sigset_t set;
  224. int pid, ret;
  225. act.sa_handler = &handler;
  226. sigfillset(&act.sa_mask);
  227. @@ -2354,11 +2354,11 @@ main() {
  228. pid=fork();
  229. if(pid==0) return 0;
  230. if(pid>0) {
  231. sigemptyset(&set);
  232. ret=sigsuspend(&set);
  233. - exit(child==0);
  234. + return(child==0);
  235. }
  236. }
  237. ]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])])
  238. if test x$zsh_cv_sys_sigsuspend = xno; then
  239. AC_DEFINE(BROKEN_POSIX_SIGSUSPEND)
  240. @@ -2387,18 +2387,18 @@ case "x$zsh_working_tcsetpgrp" in
  241. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  242. #include <sys/types.h>
  243. #include <unistd.h>
  244. #include <fcntl.h>
  245. #include <stdlib.h>
  246. -main() {
  247. +int main() {
  248. int fd;
  249. int ret;
  250. fd=open("/dev/tty", O_RDWR);
  251. if (fd < 0) exit(2);
  252. ret=tcsetpgrp(fd, tcgetpgrp(fd));
  253. if (ret < 0) exit(1);
  254. - exit(0);
  255. + return(0);
  256. }
  257. ]])],[zsh_cv_sys_tcsetpgrp=yes],[
  258. case $? in
  259. 1) zsh_cv_sys_tcsetpgrp=no;;
  260. 2) zsh_cv_sys_tcsetpgrp=notty;;
  261. @@ -2434,19 +2434,19 @@ if test x$ac_cv_func_getpwnam = xyes; th
  262. #include <pwd.h>
  263. #include <stdio.h>
  264. #include <string.h>
  265. #include <stdlib.h>
  266. #include <unistd.h>
  267. -main() {
  268. +int main() {
  269. struct passwd *pw1, *pw2;
  270. char buf[1024], name[1024];
  271. sprintf(buf, "%d:%d", getpid(), rand());
  272. pw1=getpwnam(buf);
  273. if (pw1) strcpy(name, pw1->pw_name);
  274. sprintf(buf, "%d:%d", rand(), getpid());
  275. pw2=getpwnam(buf);
  276. - exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
  277. + return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
  278. }
  279. ]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])])
  280. if test x$zsh_cv_sys_getpwnam_faked = xyes; then
  281. AC_DEFINE(GETPWNAM_FAKED)
  282. fi
  283. @@ -2763,22 +2763,20 @@ elif test "x$dynamic" = xyes; then
  284. zsh_cv_sys_elf,
  285. [AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */
  286. #include <fcntl.h>
  287. #include <stdlib.h>
  288. #include <unistd.h>
  289. -main(argc, argv)
  290. -int argc;
  291. -char *argv[];
  292. +int main(int argc, char *argv[])
  293. {
  294. char b[4];
  295. int i = open(argv[0],O_RDONLY);
  296. if(i == -1)
  297. exit(1); /* fail */
  298. if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
  299. - exit(0); /* succeed (yes, it's ELF) */
  300. + return(0); /* succeed (yes, it's ELF) */
  301. else
  302. - exit(1); /* fail */
  303. + return(1); /* fail */
  304. }]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])])
  305. # We use [0-9]* in case statements, so need to change quoting
  306. changequote(, )
  307. @@ -2908,11 +2908,11 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
  308. EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-rdynamic}"],[zsh_cvs_rdynamic_available=no])
  309. LDFLAGS="$old_LDFLAGS")
  310. AC_CACHE_CHECK(if your dlsym() needs a leading underscore,
  311. zsh_cv_func_dlsym_needs_underscore,
  312. [echo failed >conftestval && cat >conftest.c <<EOM
  313. -fred () { }
  314. +void fred () { }
  315. EOM
  316. AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest.c 1>&AS_MESSAGE_LOG_FD) &&
  317. AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) &&
  318. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  319. #include <stdio.h>
  320. @@ -2943,34 +2941,34 @@ char *zsh_gl_sym_addr ;
  321. #define RTLD_LAZY 1
  322. #endif
  323. extern int fred() ;
  324. -main()
  325. +int main()
  326. {
  327. void * handle ;
  328. void * symbol ;
  329. FILE *f=fopen("conftestval", "w");
  330. if (!f) exit(1);
  331. handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ;
  332. if (handle == NULL) {
  333. fprintf (f, "dlopen failed") ;
  334. - exit(1);
  335. + return(1);
  336. }
  337. symbol = dlsym(handle, "fred") ;
  338. if (symbol == NULL) {
  339. /* try putting a leading underscore */
  340. symbol = dlsym(handle, "_fred") ;
  341. if (symbol == NULL) {
  342. fprintf (f, "dlsym failed") ;
  343. - exit(1);
  344. + return(1);
  345. }
  346. fprintf (f, "yes") ;
  347. }
  348. else
  349. fprintf (f, "no") ;
  350. - exit(0);
  351. + return(0);
  352. }]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed
  353. dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])])
  354. if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then
  355. AC_DEFINE(DLSYM_NEEDS_UNDERSCORE)
  356. elif test "x$zsh_cv_func_dlsym_needs_underscore" != xno; then
  357. --- a/aczsh.m4.old
  358. +++ b/aczsh.m4
  359. @@ -42,10 +42,11 @@ AC_DEFUN(zsh_64_BIT_TYPE,
  360. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  361. #ifdef HAVE_SYS_TYPES_H
  362. #include <sys/types.h>
  363. #endif
  364. +int
  365. main()
  366. {
  367. $1 foo = 0;
  368. int bar = (int) foo;
  369. return sizeof($1) != 8;
  370. @@ -144,33 +145,34 @@ char *zsh_gl_sym_addr ;
  371. #endif
  372. #ifndef RTLD_GLOBAL
  373. #define RTLD_GLOBAL 0
  374. #endif
  375. +int
  376. main()
  377. {
  378. void *handle1, *handle2;
  379. void *(*zsh_getaddr1)(), *(*zsh_getaddr2)();
  380. void *sym1, *sym2;
  381. handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  382. - if(!handle1) exit(1);
  383. + if(!handle1) return(1);
  384. handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  385. - if(!handle2) exit(1);
  386. + if(!handle2) return(1);
  387. zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
  388. zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2");
  389. sym1 = zsh_getaddr1();
  390. sym2 = zsh_getaddr2();
  391. - if(!sym1 || !sym2) exit(1);
  392. - if(sym1 != sym2) exit(1);
  393. + if(!sym1 || !sym2) return(1);
  394. + if(sym1 != sym2) return(1);
  395. dlclose(handle1);
  396. handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  397. - if(!handle1) exit(1);
  398. + if(!handle1) return(1);
  399. zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
  400. sym1 = zsh_getaddr1();
  401. - if(!sym1) exit(1);
  402. - if(sym1 != sym2) exit(1);
  403. - exit(0);
  404. + if(!sym1) return(1);
  405. + if(sym1 != sym2) return(1);
  406. + return(0);
  407. }
  408. ]])],[zsh_cv_shared_$1=yes],
  409. [zsh_cv_shared_$1=no],
  410. [zsh_cv_shared_$1=no]
  411. )
  412. @@ -226,23 +228,23 @@ char *zsh_gl_sym_addr ;
  413. #endif
  414. #ifndef RTLD_GLOBAL
  415. #define RTLD_GLOBAL 0
  416. #endif
  417. -
  418. +int
  419. main()
  420. {
  421. void *handle1, *handle2;
  422. int (*fred1)(), (*fred2)();
  423. handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  424. - if(!handle1) exit(1);
  425. + if(!handle1) return(1);
  426. handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  427. - if(!handle2) exit(1);
  428. + if(!handle2) return(1);
  429. fred1 = (int (*)()) dlsym(handle1, "${us}fred");
  430. fred2 = (int (*)()) dlsym(handle2, "${us}fred");
  431. - if(!fred1 || !fred2) exit(1);
  432. - exit((*fred1)() != 42 || (*fred2)() != 69);
  433. + if(!fred1 || !fred2) return(1);
  434. + return((*fred1)() != 42 || (*fred2)() != 69);
  435. }
  436. ]])],[zsh_cv_sys_dynamic_clash_ok=yes],
  437. [zsh_cv_sys_dynamic_clash_ok=no],
  438. [zsh_cv_sys_dynamic_clash_ok=no]
  439. )
  440. @@ -302,21 +304,22 @@ char *zsh_gl_sym_addr ;
  441. #endif
  442. #ifndef RTLD_GLOBAL
  443. #define RTLD_GLOBAL 0
  444. #endif
  445. +int
  446. main()
  447. {
  448. void *handle;
  449. int (*barneysym)();
  450. handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  451. - if(!handle) exit(1);
  452. + if(!handle) return(1);
  453. handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  454. - if(!handle) exit(1);
  455. + if(!handle) return(1);
  456. barneysym = (int (*)()) dlsym(handle, "${us}barney");
  457. - if(!barneysym) exit(1);
  458. - exit((*barneysym)() != 69);
  459. + if(!barneysym) return(1);
  460. + return((*barneysym)() != 69);
  461. }
  462. ]])],[zsh_cv_sys_dynamic_rtld_global=yes],
  463. [zsh_cv_sys_dynamic_rtld_global=no],
  464. [zsh_cv_sys_dynamic_rtld_global=no]
  465. )
  466. @@ -372,19 +375,20 @@ char *zsh_gl_sym_addr ;
  467. #endif
  468. #ifndef RTLD_GLOBAL
  469. #define RTLD_GLOBAL 0
  470. #endif
  471. +int
  472. main()
  473. {
  474. void *handle;
  475. int (*barneysym)();
  476. handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  477. - if(!handle) exit(1);
  478. + if(!handle) return(1);
  479. barneysym = (int (*)()) dlsym(handle, "${us}barney");
  480. - if(!barneysym) exit(1);
  481. - exit((*barneysym)() != 69);
  482. + if(!barneysym) return(1);
  483. + return((*barneysym)() != 69);
  484. }
  485. int fred () { return 42; }
  486. ]])],[zsh_cv_sys_dynamic_execsyms=yes],
  487. [zsh_cv_sys_dynamic_execsyms=no],
  488. @@ -446,19 +450,20 @@ char *zsh_gl_sym_addr ;
  489. #endif
  490. #ifndef RTLD_GLOBAL
  491. #define RTLD_GLOBAL 0
  492. #endif
  493. +int
  494. main()
  495. {
  496. void *handle;
  497. int (*barneysym)();
  498. handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  499. - if(!handle) exit(1);
  500. + if(!handle) return(1);
  501. barneysym = (int (*)()) dlsym(handle, "${us}barney");
  502. - if(!barneysym) exit(1);
  503. - exit((*barneysym)() != 69);
  504. + if(!barneysym) return(1);
  505. + return((*barneysym)() != 69);
  506. }
  507. int fred () { return 42; }
  508. ]])],[zsh_cv_sys_dynamic_strip_exe=yes],
  509. [zsh_cv_sys_dynamic_strip_exe=no],
  510. @@ -514,19 +519,20 @@ char *zsh_gl_sym_addr ;
  511. #endif
  512. #ifndef RTLD_GLOBAL
  513. #define RTLD_GLOBAL 0
  514. #endif
  515. +int
  516. main()
  517. {
  518. void *handle;
  519. int (*fredsym)();
  520. handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
  521. - if(!handle) exit(1);
  522. + if(!handle) return(1);
  523. fredsym = (int (*)()) dlsym(handle, "${us}fred");
  524. - if(!fredsym) exit(1);
  525. - exit((*fredsym)() != 42);
  526. + if(!fredsym) return(1);
  527. + return((*fredsym)() != 42);
  528. }
  529. ]])],[zsh_cv_sys_dynamic_strip_lib=yes],
  530. [zsh_cv_sys_dynamic_strip_lib=no],
  531. [zsh_cv_sys_dynamic_strip_lib=no]
  532. )