Code Monkey home page Code Monkey logo

Comments (8)

KevinOfNeu avatar KevinOfNeu commented on July 18, 2024

same question

from os.

seclorum avatar seclorum commented on July 18, 2024

Just to report in: I do not have this problem, and am able to build minocaOS clean on my macOS rig.

from os.

aequitas avatar aequitas commented on July 18, 2024

Gcc output:

gcc  -I /Users/johan/Projecten/raspberrypi/os/apps/swiss/uos/.. -I . -I  /Users/johan/Projecten/raspberrypi/os/include -DDEBUG=1 -Wall -Werror -O1 -fno-builtin -fno-omit-frame-pointer -g -save-temps=obj -ffunction-sections -fdata-sections -fvisibility=hidden -fpic -Wno-tautological-compare -Wno-parentheses-equality -c -o swlib/uos.o /Users/johan/Projecten/raspberrypi/os/apps/swiss/uos/../swlib/uos.c

looks like libc/time.h in not included (but another one is found?), however the include config seems correct: https://github.com/minoca/os/blob/master/apps/swiss/Makefile#L30-L32

from os.

evangreen avatar evangreen commented on July 18, 2024

Swiss is another case of a utility that is built for both the build machine and Minoca. Looks like we're failing to build for the build machine.

My main GCC comes from xcode 8.0 (8A218a), and it's really clang pretending to be GCC:

Evans-MacBook-Pro-2:os Evan$ echo | gcc -E -v -
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 274.1 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -fdebug-compilation-dir /Users/Evan/src/os -ferror-limit 19 -fmessage-length 120 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c -
clang -cc1 version 8.0.0 (clang-800.0.38) default target x86_64-apple-darwin15.6.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks (framework directory)
End of search list.

However I've also built successfully with Homebrew GCC 6.2.0:

Evans-MacBook-Pro-2:os Evan$ echo | gcc-6 -E -v -
Using built-in specs.
COLLECT_GCC=gcc-6
Target: x86_64-apple-darwin15.6.0
Configured with: ../configure --build=x86_64-apple-darwin15.6.0 --prefix=/usr/local/Cellar/gcc/6.2.0 --libdir=/usr/local/Cellar/gcc/6.2.0/lib/gcc/6 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-6 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --with-build-config=bootstrap-debug --disable-werror --with-pkgversion='Homebrew gcc 6.2.0' --with-bugurl=https://github.com/Homebrew/homebrew/issues --enable-plugin --disable-nls --enable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
Thread model: posix
gcc version 6.2.0 (Homebrew gcc 6.2.0) 
COLLECT_GCC_OPTIONS='-E' '-v' '-mmacosx-version-min=10.11.6' '-mtune=core2'
 /usr/local/Cellar/gcc/6.2.0/libexec/gcc/x86_64-apple-darwin15.6.0/6.2.0/cc1 -E -quiet -v -D__DYNAMIC__ - -fPIC -mmacosx-version-min=10.11.6 -mtune=core2
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/local/include"
ignoring nonexistent directory "/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/../../../../../../x86_64-apple-darwin15.6.0/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/include
 /usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/include-fixed
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=/usr/local/Cellar/gcc/6.2.0/libexec/gcc/x86_64-apple-darwin15.6.0/6.2.0/:/usr/local/Cellar/gcc/6.2.0/libexec/gcc/x86_64-apple-darwin15.6.0/6.2.0/:/usr/local/Cellar/gcc/6.2.0/libexec/gcc/x86_64-apple-darwin15.6.0/:/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/:/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/
LIBRARY_PATH=/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/:/usr/local/Cellar/gcc/6.2.0/lib/gcc/6/gcc/x86_64-apple-darwin15.6.0/6.2.0/../../../
COLLECT_GCC_OPTIONS='-E' '-v' '-mmacosx-version-min=10.11.6' '-mtune=core2'

It looks like clock_gettime and CLOCK_MONOTONIC were only very recently added to macOS. They're in my 10.12 SDK, but I'm wondering if you've got a slightly older one. I'm not a mac guru, but it strikes me as weird that I'm building on a 10.12 SDK while running 10.11.6. Does that mean this GCC may not be able to run the programs it produces?

@aequitas What built-in include paths do you have? Slightly older SDK? If you're willing to download the latest SDK, that might be a fast workaround. I'll also start looking at alternate functions we can call on macOS.

from os.

aequitas avatar aequitas commented on July 18, 2024

@evangreen thanks for pointing out how to verify the gcc environment, from what I can see I am missing the MacOSX SDK includes on clang as well as gcc-6. I will try to find out why. The SDK with content is present, but just not found by clang/gcc it seems.

~/P/raspberrypi (master|…1) $ echo | gcc -E -v -
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.1 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -fdebug-compilation-dir /Users/johan/Projecten/raspberrypi -ferror-limit 19 -fmessage-length 198 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c -
clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 329 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2
$ grep clock_settime /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/*.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:int clock_settime(clockid_t __clock_id, const struct timespec *__tp);

from os.

aequitas avatar aequitas commented on July 18, 2024

I resolved my issues by exportingSDKROOT=$(xcrun --show-sdk-path). I don't know if that is the recommended/required way or that I messed up my Xcode in the past (did a full reinstall with no result).

I now have successfully built a x86 pc.img have not tested it yet, still need to figure out if armv6 cross-compiling works as well now.

from os.

evangreen avatar evangreen commented on July 18, 2024

Thanks @aequitas . I've made a note of your SDKROOT fix in the readme.

Sounds like this bug is fixed. Last call?

from os.

aequitas avatar aequitas commented on July 18, 2024

I consider this problem solved, I am able to build an image. I still need to test for armv6 and test it on my hardware, but I have no reason to expect it doesn't run. If I run into issues there I will (re)open an issue. Thanks for the support, I have been looking for a while for a OS like Minoca, I'm curious if it fits my need.

One minor thing that doesn't work yet is a 'rel' build:

Compiling - bconf.c
error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'?
      [-Werror,-Wunknown-warning-option]
make[6]: *** [bconf.o] Error 1
make[5]: *** [build] Error 2
make[4]: *** [bconflib] Error 2
make[3]: *** [/Users/johan/Projecten/minoca/armv6rel/obj/os/lib] Error 2
make[2]: *** [tool-build-libc] Error 2
make[1]: *** [/Users/johan/Projecten/minoca/armv6rel/obj/third-party/gcc-4.9.2.tool/build.stamp] Error 2
make: *** [/Users/johan/Projecten/minoca/armv6rel/tools/bin//arm-none-minoca-gcc] Error 2

which seems due to: https://github.com/minoca/os/blob/master/minoca.mk#L208

for now I just build dbg, and this should be easy to work around if I want a rel, so its just as FYI.

from os.

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.