zsh-workers
 help / color / mirror / Atom feed
* Many configure tests broken with clang 12
@ 2020-11-16 11:34 FX
  2020-11-16 11:45 ` Jun. T
  0 siblings, 1 reply; 4+ messages in thread
From: FX @ 2020-11-16 11:34 UTC (permalink / raw)
  To: zsh-workers

Hello,

Building zsh 5.8 with clang 12 (which is the system compiler on recent macOS versions) leads to a completely broken zsh. This is because many configure tests actually fail, when they should succeed, because of undeclared functions. Take for example TGETENT_ACCEPTS_NULL in configure.ac:

[AC_RUN_IFELSE([AC_LANG_SOURCE([[
main()
{
    char buf[4096];
    int r1 = tgetent(buf, "vt100");
    int r2 = tgetent((char*)0,"vt100");
    if (r1 >= 0 && r1 == r2) {
        char tbuf[1024], *u;
        u = tbuf;
        tgetstr("cl", &u);
        creat("conftest.tgetent", 0640);
    }
    exit((r1 != r2) || r2 == -1);
}
]])]

This will fail for two reasons:

conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]

tgetstr() should require the <term.h> header to be included in the test. And exit() needs <stdlib.h>

This occurs in a lot of places throughout the configure script. I have found the list below (see at end of message). clang 12 has made -Wimplicit-function-declaration into an error by default, which explains why these tests are now starting to fail. See our original report on Homebrew: https://github.com/Homebrew/homebrew-core/issues/64921

Best regards,
FX






fx@rmeur zsh-5.8 % grep 'implicitly declaring' config.log
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:236:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:255:24: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:255:40: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:293:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:287:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:302:9: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:286:5: error: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
conftest.c:288:14: error: implicitly declaring library function 'strcpy' with type 'char *(char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:5: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
conftest.c:291:31: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
conftest.c:320:13: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
fx@rmeur zsh-5.8 % grep 'C99' config.log        
conftest.c:228:14: error: implicit declaration of function 'tgetent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:234:2: error: implicit declaration of function 'creat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:228:14: error: implicit declaration of function 'tgetent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:233:6: error: implicit declaration of function 'tgetstr' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:234:2: error: implicit declaration of function 'creat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:287:5: error: implicit declaration of function 'unlink' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:289:8: error: implicit declaration of function 'mkfifo' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:294:11: error: implicit declaration of function 'fork' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:299:17: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:302:22: error: implicit declaration of function 'write' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:286:27: error: implicit declaration of function 'getpid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:286:37: error: implicit declaration of function 'rand' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
conftest.c:298:5: error: implicit declaration of function 'read' is invalid in C99 [-Werror,-Wimplicit-function-declaration]



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

* Re: Many configure tests broken with clang 12
  2020-11-16 11:34 Many configure tests broken with clang 12 FX
@ 2020-11-16 11:45 ` Jun. T
  2020-11-16 11:53   ` FX
  0 siblings, 1 reply; 4+ messages in thread
From: Jun. T @ 2020-11-16 11:45 UTC (permalink / raw)
  To: zsh-workers; +Cc: FX


> 2020/11/16 20:34, FX <fxcoudert@gmail.com> wrote:
> 
> Building zsh 5.8 with clang 12 (which is the system compiler on recent macOS versions) leads to a completely broken zsh. This is because many configure tests actually fail,

Please try the patch in the following post (several posts before your post):
[PATCH] add function prototypes for tests in configure.ac

I will push the patch soon.

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

* Re: Many configure tests broken with clang 12
  2020-11-16 11:45 ` Jun. T
@ 2020-11-16 11:53   ` FX
  2020-11-16 12:14     ` Jun. T
  0 siblings, 1 reply; 4+ messages in thread
From: FX @ 2020-11-16 11:53 UTC (permalink / raw)
  To: Jun. T; +Cc: zsh-workers

Dear Jun,

> Please try the patch in the following post (several posts before your post):
> [PATCH] add function prototypes for tests in configure.ac

I cannot find it in the archives: https://www.zsh.org/mla/workers/2020/index.html
I looked through the archives to search for a bug report (or a patch), and looked at git to see if it had been fixed.

FX

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

* Re: Many configure tests broken with clang 12
  2020-11-16 11:53   ` FX
@ 2020-11-16 12:14     ` Jun. T
  0 siblings, 0 replies; 4+ messages in thread
From: Jun. T @ 2020-11-16 12:14 UTC (permalink / raw)
  To: zsh-workers; +Cc: FX


> 2020/11/16 20:53, FX <fxcoudert@gmail.com> wrote:
> 
> I cannot find it in the archives: https://www.zsh.org/mla/workers/2020/index.html

Sorry, the archive is currently out of sync.
I have pushed the patch to the git repo (git://git.code.sf.net/p/zsh/code).
Please clone/pull it and try.

Jun

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

end of thread, other threads:[~2020-11-16 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 11:34 Many configure tests broken with clang 12 FX
2020-11-16 11:45 ` Jun. T
2020-11-16 11:53   ` FX
2020-11-16 12:14     ` Jun. T

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git