You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gmake[1]: Leaving directory '/tmp/v'
cd ./thirdparty/tcc && git clean -xf && git pull --quiet
gcc -std=gnu99 -w -o v1.exe ./vc/v.c -lm -lpthread
./vc/v.c:2052:2: error: #error VERROR_MESSAGE Header file <sys/ptrace.h>, needed for module os was not found. Please install the corresponding development headers.
2052 | #error VERROR_MESSAGE Header file <sys/ptrace.h>, needed for module os was not found. Please install the corresponding development headers.
| ^~~~~
./vc/v.c: In function 'time__time_with_unix':
./vc/v.c:33053:18: error: 'struct tm' has no member named 'tm_gmtoff'
33053 | .tm_gmtoff = 0,
| ^~~~~~~~~
./vc/v.c: In function 'time__Time_strftime':
./vc/v.c:33099:174: error: 'struct tm' has no member named 'tm_gmtoff'
33099 | struct tm* tm = ((struct tm*)memdup(&(struct tm){.tm_sec = 0,.tm_min = 0,.tm_hour = 0,.tm_mday = 0,.tm_mon = 0,.tm_year = 0,.tm_wday = 0,.tm_yday = 0,.tm_isdst = 0,.tm_gmtoff = 0,}, sizeof(struct tm)));
| ^~~~~~~~~
./vc/v.c: In function 'time__Time_local':
./vc/v.c:33473:157: error: 'struct tm' has no member named 'tm_gmtoff'
33473 | struct tm loc_tm = ((struct tm){.tm_sec = 0,.tm_min = 0,.tm_hour = 0,.tm_mday = 0,.tm_mon = 0,.tm_year = 0,.tm_wday = 0,.tm_yday = 0,.tm_isdst = 0,.tm_gmtoff = 0,});
| ^~~~~~~~~
./vc/v.c: In function 'time__linux_now':
./vc/v.c:33508:157: error: 'struct tm' has no member named 'tm_gmtoff'
33508 | struct tm loc_tm = ((struct tm){.tm_sec = 0,.tm_min = 0,.tm_hour = 0,.tm_mday = 0,.tm_mon = 0,.tm_year = 0,.tm_wday = 0,.tm_yday = 0,.tm_isdst = 0,.tm_gmtoff = 0,});
| ^~~~~~~~~
gmake: *** [GNUmakefile:113: all] Error 1
Possible Solution
Working solution:
Step 1: Replace <sys/ptrace.h> in vc/v.c definitions with <uninstd.h> and <sys/types.h> according to ptrace illumos man page.
Step 2: Edit '/usr/include/iso/time_iso.h' file's 'tm' struct to include an 'int tm_gmtoff' field, as this is not default under Solaris.
Step 3: Install and configure C library and Include paths for gc.h. Can be installed with pkgsrc tool from Joyent/SmartOS. I used 'v -cflags "-Wl,-rpath=/opt/local/lib -L/opt/local/lib -I/opt/local/include"' to include the needed libraries for a Hello World program compilation.
Additional Information/Context
It seems like this compilation error is due to missing struct fields under Solaris-based environments. I'm not familiar with Makefile rules or how to create an automated solution to fix this, or if that would even be possible.
V version
0.4.7 ca5f47a
Environment details (OS name and version, etc.)
V full version: V 0.4.7 0fb95a8.ca5f47a
OS: solaris, ,
Processor: 12 cpus, 64bit, little endian
Describe the bug
Compilation of Vlang/v fails under Solaris/Illumos based systems due to lack of tm_gmtoff field in tm struct in time_iso.h, and use of sys/ptrace.h.
Reproduction Steps
git clone https://github.com/vlang/v
cd v
gmake
Expected Behavior
No errors
Current Behavior
gmake[1]: Leaving directory '/tmp/v'
cd ./thirdparty/tcc && git clean -xf && git pull --quiet
gcc -std=gnu99 -w -o v1.exe ./vc/v.c -lm -lpthread
./vc/v.c:2052:2: error: #error VERROR_MESSAGE Header file <sys/ptrace.h>, needed for module
os
was not found. Please install the corresponding development headers.2052 | #error VERROR_MESSAGE Header file <sys/ptrace.h>, needed for module
os
was not found. Please install the corresponding development headers.| ^~~~~
./vc/v.c: In function 'time__time_with_unix':
./vc/v.c:33053:18: error: 'struct tm' has no member named 'tm_gmtoff'
33053 | .tm_gmtoff = 0,
| ^~~~~~~~~
./vc/v.c: In function 'time__Time_strftime':
./vc/v.c:33099:174: error: 'struct tm' has no member named 'tm_gmtoff'
33099 | struct tm* tm = ((struct tm*)memdup(&(struct tm){.tm_sec = 0,.tm_min = 0,.tm_hour = 0,.tm_mday = 0,.tm_mon = 0,.tm_year = 0,.tm_wday = 0,.tm_yday = 0,.tm_isdst = 0,.tm_gmtoff = 0,}, sizeof(struct tm)));
| ^~~~~~~~~
./vc/v.c: In function 'time__Time_local':
./vc/v.c:33473:157: error: 'struct tm' has no member named 'tm_gmtoff'
33473 | struct tm loc_tm = ((struct tm){.tm_sec = 0,.tm_min = 0,.tm_hour = 0,.tm_mday = 0,.tm_mon = 0,.tm_year = 0,.tm_wday = 0,.tm_yday = 0,.tm_isdst = 0,.tm_gmtoff = 0,});
| ^~~~~~~~~
./vc/v.c: In function 'time__linux_now':
./vc/v.c:33508:157: error: 'struct tm' has no member named 'tm_gmtoff'
33508 | struct tm loc_tm = ((struct tm){.tm_sec = 0,.tm_min = 0,.tm_hour = 0,.tm_mday = 0,.tm_mon = 0,.tm_year = 0,.tm_wday = 0,.tm_yday = 0,.tm_isdst = 0,.tm_gmtoff = 0,});
| ^~~~~~~~~
gmake: *** [GNUmakefile:113: all] Error 1
Possible Solution
Working solution:
Step 1: Replace <sys/ptrace.h> in vc/v.c definitions with <uninstd.h> and <sys/types.h> according to ptrace illumos man page.
Step 2: Edit '/usr/include/iso/time_iso.h' file's 'tm' struct to include an 'int tm_gmtoff' field, as this is not default under Solaris.
Step 3: Install and configure C library and Include paths for gc.h. Can be installed with pkgsrc tool from Joyent/SmartOS. I used 'v -cflags "-Wl,-rpath=/opt/local/lib -L/opt/local/lib -I/opt/local/include"' to include the needed libraries for a Hello World program compilation.
Additional Information/Context
It seems like this compilation error is due to missing struct fields under Solaris-based environments. I'm not familiar with Makefile rules or how to create an automated solution to fix this, or if that would even be possible.
V version
0.4.7 ca5f47a
Environment details (OS name and version, etc.)
V full version: V 0.4.7 0fb95a8.ca5f47a
OS: solaris, ,
Processor: 12 cpus, 64bit, little endian
getwd: /opt/v
vexe: /opt/v/v
vexe mtime: 2024-09-16 10:14:41
vroot: OK, value: /opt/v
VMODULES: OK, value: /root/.vmodules
VTMP: OK, value: /tmp/v_0
Git version: git version 2.44.2
Git vroot status: weekly.2024.37-3-gca5f47a9-dirty (4 commit(s) behind V master)
.git/config present: true
CC version: cc (OmniOS 151050/13.2.0-il-0) 13.2.0
thirdparty/tcc status: thirdparty-unknown-unknown de82a13
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: