Coder Social home page Coder Social logo

Installation problem about gobo HOT 5 OPEN

rpx99 avatar rpx99 commented on August 31, 2024
Installation problem

from gobo.

Comments (5)

ebezault avatar ebezault commented on August 31, 2024

Although I never tried it on openBSD, I guess that the problem above comes from the fact that the install script does not know that cc means clang. Can clang be called directly on your machine?

$ clang -v

If so, you can try to run:

$GOBO/bin/install.sh clang

Also note that you may run into other problems because as I said above, openBSD is not part of my available platforms. GitHub Actions only provides Linux Ubuntu, MacOs and Windows.

from gobo.

rpx99 avatar rpx99 commented on August 31, 2024

Thanks for your swift reply and your suggestion! Looks better but does not compile fully.

tron$ clang -v
OpenBSD clang version 16.0.6
Target: amd64-unknown-openbsd7.5
Thread model: posix
InstalledDir: /usr/bin

tron$ ./bootstrap.sh clang                
Executing bootstrap.sh...
Compiling gec (bootstrap 0)...
gec8.c(gec8.o:(GE_append_to_exception_trace_buffer)): warning: strcpy() is almost always misused, please use strlcpy()
gec8.c(gec8.o:(GE_raise_exception)): warning: sprintf() is often misused, please use snprintf()
Compiling gec (bootstrap 1)...
Degree 6: 0/0/0 0:0:0.049
Degree 5: 0/0/0 0:0:0.287
Degree 4: 0/0/0 0:0:0.153
Degree 3: 0/0/0 0:0:0.225
Degree -2: 0/0/0 0:0:1.625
Degree -3: 0/0/0 0:0:1.031
In file included from gec1.c:59:
In file included from /home/rpx/Downloads/eiffel/gobo/tool/gec/backend/c/boehm_gc/extra/gc.c:75:
/home/rpx/Downloads/eiffel/gobo/tool/gec/backend/c/boehm_gc/extra/../pthread_support.c:392:20: warning: call to undeclared function 'pthread_setname_np'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        if (EXPECT(pthread_setname_np(pthread_self(), name_buf) != 0, FALSE))
                   ^
1 warning generated.
gec2.c(gec2.o:(T49s1)): warning: strcpy() is almost always misused, please use strlcpy()
gec11.c(gec11.o:(GE_raise_exception)): warning: sprintf() is often misused, please use snprintf()
ld: error: undefined symbol: pthread_setname_np
>>> referenced by gec1.c
>>>               gec1.o:(GC_mark_thread)
>>> did you mean: pthread_set_name_np
>>> defined in: /usr/lib/libpthread.so.27.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Degree -4: 0/0/0 0:0:24.008
Total Time: 0/0/0 0:0:27.379
Compiling gec (bootstrap 2)...
mv: /home/rpx/Downloads/eiffel/gobo/bin/gec: No such file or directory
./bootstrap.sh[247]: /home/rpx/Downloads/eiffel/gobo/bin/gec1: not found
rm: /home/rpx/Downloads/eiffel/gobo/bin/gec1: No such file or directory
strip: error: 'gec': No such file or directory

Btw. I tried to copy the clang options as cc options in the bootstrap.sh file but this errors earlier as there are more switches later on.

Executing bootstrap.sh...
Compiling gec (bootstrap 0)...
gec8.c(gec8.o:(GE_append_to_exception_trace_buffer)): warning: strcpy() is almost always misused, please use strlcpy()
gec8.c(gec8.o:(GE_raise_exception)): warning: sprintf() is often misused, please use snprintf()
Compiling gec (bootstrap 1)...
Degree 6: 0/0/0 0:0:0.047
Degree 5: 0/0/0 0:0:0.335
Degree 4: 0/0/0 0:0:0.158
Degree 3: 0/0/0 0:0:0.210
Degree -2: 0/0/0 0:0:1.681
Degree -3: 0/0/0 0:0:1.051
cc: warning: argument unused during compilation: '-fast' [-Wunused-command-line-argument]
In file included from gec11.c:1:
./gec.h:2316:10: fatal error: 'gc.h' file not found
#include "gc.h"
         ^~~~~~
1 error generated.
Degree -4: 0/0/0 0:0:4.035
Total Time: 0/0/0 0:0:7.519
Compiling gec (bootstrap 2)...
mv: /home/rpx/Downloads/eiffel/gobo/bin/gec: No such file or directory
./bootstrap.sh[247]: /home/rpx/Downloads/eiffel/gobo/bin/gec1: not found
rm: /home/rpx/Downloads/eiffel/gobo/bin/gec1: No such file or directory
strip: error: 'gec': No such file or directory

Wonder if cc should not be equal to clang in general?

from gobo.

rpx99 avatar rpx99 commented on August 31, 2024

There seems to be even a switch in pthread:support.c


#     ifdef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID /* iOS, OS X */
        (void)pthread_setname_np(name_buf);
#     elif defined(HAVE_PTHREAD_SET_NAME_NP) /* OpenBSD */
        pthread_set_name_np(pthread_self(), name_buf);
#     else /* Linux, Solaris, etc. */
        if (EXPECT(pthread_setname_np(pthread_self(), name_buf) != 0, FALSE))
          WARN("pthread_setname_np failed\n", 0);
#     endif

So it seems HAVE_PTHREAD_SET_NAME_NP is not set?

from gobo.

rpx99 avatar rpx99 commented on August 31, 2024

For now I simply removed the code I do not need:


diff --git a/tool/gec/backend/c/boehm_gc/pthread_support.c b/tool/gec/backend/c/boehm_gc/pthread_support.c
index d344503da..295e84032 100644
--- a/tool/gec/backend/c/boehm_gc/pthread_support.c
+++ b/tool/gec/backend/c/boehm_gc/pthread_support.c
@@ -384,14 +384,7 @@
       name_buf[len] = (char)('0' + id % 10);
       name_buf[len + 1] = '\0';
 
-#     ifdef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID /* iOS, OS X */
-        (void)pthread_setname_np(name_buf);
-#     elif defined(HAVE_PTHREAD_SET_NAME_NP) /* OpenBSD */
-        pthread_set_name_np(pthread_self(), name_buf);
-#     else /* Linux, Solaris, etc. */
-        if (EXPECT(pthread_setname_np(pthread_self(), name_buf) != 0, FALSE))
-          WARN("pthread_setname_np failed\n", 0);
-#     endif
+      pthread_set_name_np(pthread_self(), name_buf);
     }
 
 # elif defined(GC_WIN32_THREADS) && !defined(MSWINCE)

Doing it properly would mean to define HAVE_PTHREAD_SET_NAME_NP in gec.h ?


#if defined(__clang__)
#	define HAVE_DL_ITERATE_PHDR
#	define GC_REQUIRE_WCSDUP
#	define HAVE_DLADDR
#	define HAVE_SYS_TYPES_H
#	define HAVE_UNISTD_H
#	if defined(GE_MACOS)
#		define HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID
#	elif !defined(GE_WINDOWS)
#		define HAVE_PTHREAD_SETNAME_NP_WITH_TID
#		define HAVE_PTHREAD_SIGMASK
#		define NO_GETCONTEXT
#	endif
#endif

from gobo.

rpx99 avatar rpx99 commented on August 31, 2024

The next issue appears now here:


Compiling gexslt...
Degree 6: 0/0/0 0:0:0.038
Degree 5: 0/0/0 0:0:0.550
Degree 4: 0/0/0 0:0:0.241
Degree 3: 0/0/0 0:0:0.159
Degree -2: 0/0/0 0:0:6.527
Degree -3: 0/0/0 0:0:2.742
gexslt25.c(gexslt25.o:(GE_append_to_exception_trace_buffer)): warning: strcpy() is almost always misused, please use strlcpy()
gexslt25.c(gexslt25.o:(GE_raise_exception)): warning: sprintf() is often misused, please use snprintf()
ld: error: undefined symbol: pow
>>> referenced by gexslt6.c
>>>               gexslt6.o:(T371f46)
>>> referenced by gexslt6.c
>>>               gexslt6.o:(T371f46)
>>> referenced by gexslt6.c
>>>               gexslt6.o:(T17f41)
>>> referenced 13 more times

ld: error: undefined symbol: floor
>>> referenced by gexslt19.c
>>>               gexslt19.o:(T836f115)
>>> referenced by gexslt19.c
>>>               gexslt19.o:(T835f113)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Degree -4: 0/0/0 0:0:49.197
Total Time: 0/0/0 0:0:59.454
strip: error: 'gexslt': No such file or directory
Cleaning up...

I tried to link with -lm but doesn't seem to work. Any idea ?

/*
description:

	"C functions used to implement class REAL"

system: "Gobo Eiffel Compiler"
copyright: "Copyright (c) 2006-2019, Eric Bezault and others"
license: "MIT License"

*/

#ifndef GE_REAL_H
#define GE_REAL_H
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#ifndef GE_EIFFEL_H
#include "ge_eiffel.h"
#endif

#include <math.h>

#ifndef GE_power
#define GE_power(x,y) pow((x),(y))
#endif
#define GE_ceiling(x) ceil(x)
#define GE_floor(x) floor(x)

from gobo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.