Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC 11.2 #564

Merged
merged 1 commit into from
Jul 29, 2021
Merged

GCC 11.2 #564

merged 1 commit into from
Jul 29, 2021

Conversation

ojeda
Copy link
Contributor

@ojeda ojeda commented Jul 28, 2021

Signed-off-by: Miguel Ojeda <[email protected]>
@partouf
Copy link
Member

partouf commented Jul 28, 2021

Compilation for GCC 11.2.0 is failing, but I can't figure out Why exactly'
https://godbolt.org/admin/logs/gcc_1120

@apmorton
Copy link
Member

apmorton commented Jul 28, 2021

../../../../gcc-11.2.0/libgo/runtime/proc.c:172:4: error: #error unknown case for SETCONTEXT_CLOBBERS_TLS
  172 | #  error unknown case for SETCONTEXT_CLOBBERS_TLS
      |    ^~~~~
../../../../gcc-11.2.0/libgo/runtime/proc.c: In function 'runtime_gogo':
../../../../gcc-11.2.0/libgo/runtime/proc.c:293:9: error: implicit declaration of function 'fixcontext'; did you mean 'setcontext'? [-Werror=implicit-function-declaration]
  293 |         fixcontext(ucontext_arg(&newg->context[0]));
      |         ^~~~~~~~~~
      |         setcontext
../../../../gcc-11.2.0/libgo/runtime/proc.c: In function 'runtime_mstart':
../../../../gcc-11.2.0/libgo/runtime/proc.c:558:9: error: implicit declaration of function 'initcontext'; did you mean 'setcontext'? [-Werror=implicit-function-declaration]
  558 |         initcontext();
      |         ^~~~~~~~~~~
      |         setcontext
      ```

@ojeda
Copy link
Contributor Author

ojeda commented Jul 28, 2021

The error seems to be that SETCONTEXT_CLOBBERS_TLS is set, which would hint at the configure test failing. Nothing seems to have changed lately around this (from a quick look, at least).

Has something changed in the environment you are building? For instance, someone hit this due to Docker blocking the sigprocmask syscall: docker-library/gcc#38 (comment). Otherwise, perhaps try to run and see if the test program is actually failing:

#include <pthread.h>
#include <stdlib.h>
#include <ucontext.h>
#include <unistd.h>

__thread int tls;

static char stack[10 * 1024 * 1024];
static ucontext_t c;

/* Called via makecontext/setcontext.  */

static void
cfn (void)
{
  exit (tls);
}

/* Called via pthread_create.  */

static void *
tfn (void *dummy)
{
  /* The thread should still see this value after calling
     setcontext.  */
  tls = 0;

  setcontext (&c);

  /* The call to setcontext should not return.  */
  abort ();
}

int
main ()
{
  pthread_t tid;

  /* The thread should not see this value.  */
  tls = 1;

  if (getcontext (&c) < 0)
    abort ();

  c.uc_stack.ss_sp = stack;
#ifdef MAKECONTEXT_STACK_TOP
  c.uc_stack.ss_sp += sizeof stack;
#endif
  c.uc_stack.ss_flags = 0;
  c.uc_stack.ss_size = sizeof stack;
  c.uc_link = NULL;
  makecontext (&c, cfn, 0);

  if (pthread_create (&tid, NULL, tfn, NULL) != 0)
    abort ();

  if (pthread_join (tid, NULL) != 0)
    abort ();

  /* The thread should have called exit.  */
  abort ();
}

@partouf partouf merged commit 8cf5fcd into compiler-explorer:main Jul 29, 2021
@ojeda ojeda deleted the gcc branch July 29, 2021 12:22
@ojeda
Copy link
Contributor Author

ojeda commented Jul 29, 2021

What was the problem in the end? Docker?

@partouf
Copy link
Member

partouf commented Jul 29, 2021

What was the problem in the end? Docker?

Probably, it got solved when I upgraded the host from Ub18 to 20 (had to rebuild the instance from scratch due to other reasons, but was based on a really old version of our builder)

@ojeda
Copy link
Contributor Author

ojeda commented Jul 29, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants