Changeset 0c96e6cb in mainline
- Timestamp:
- 2013-10-18T11:00:23Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b5851913
- Parents:
- 39bcc99 (diff), 9f9450b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 10 added
- 3 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r39bcc99 r0c96e6cb 291 291 @ "gcc_cross" GNU C Compiler (cross-compiler) 292 292 @ "gcc_native" GNU C Compiler (native) 293 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler) 293 294 @ "icc" Intel C Compiler 294 295 @ "clang" Clang … … 299 300 @ "gcc_native" GNU C Compiler (native) 300 301 @ "icc" Intel C Compiler 302 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler) 301 303 ! [PLATFORM=ia64] COMPILER (choice) 302 304 … … 304 306 @ "gcc_cross" GNU C Compiler (cross-compiler) 305 307 @ "gcc_native" GNU C Compiler (native) 308 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler) 306 309 ! [PLATFORM=mips32|PLATFORM=mips64|PLATFORM=ppc32] COMPILER (choice) 307 310 … … 309 312 @ "gcc_cross" GNU C Compiler (cross-compiler) 310 313 @ "gcc_native" GNU C Compiler (native) 314 @ "gcc_helenos" GNU C Compiler (experimental HelenOS-specific cross-compiler) 311 315 @ "clang" Clang 312 316 ! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=sparc64] COMPILER (choice) … … 319 323 @ "ia32" Intel IA-32 320 324 @ "mips32" MIPS 32-bit 321 ! [PLATFORM=abs32le& COMPILER=gcc_cross] CROSS_TARGET (choice)325 ! [PLATFORM=abs32le&(COMPILER=gcc_cross|COMPILER=gcc_helenos)] CROSS_TARGET (choice) 322 326 323 327 -
boot/Makefile.build
r39bcc99 r0c96e6cb 75 75 endif 76 76 77 ifeq ($(COMPILER),gcc_helenos) 78 CFLAGS = $(GCC_CFLAGS) $(EXTRA_CFLAGS) 79 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 80 endif 81 82 77 83 ifeq ($(COMPILER),icc) 78 84 CFLAGS = $(ICC_CFLAGS) $(EXTRA_CFLAGS) -
kernel/Makefile
r39bcc99 r0c96e6cb 167 167 168 168 ifeq ($(COMPILER),gcc_cross) 169 CFLAGS = $(GCC_CFLAGS) 170 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 171 INSTRUMENTATION = -finstrument-functions 172 endif 173 174 ifeq ($(COMPILER),gcc_helenos) 169 175 CFLAGS = $(GCC_CFLAGS) 170 176 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) -
tools/autotool.py
r39bcc99 r0c96e6cb 186 186 gnu_target = None 187 187 clang_target = None 188 helenos_target = None 188 189 cc_args = [] 189 190 … … 195 196 gnu_target = "arm-linux-gnueabi" 196 197 clang_target = "arm-unknown-linux" 198 helenos_target = "arm-helenos-gnueabi" 197 199 198 200 if (config['CROSS_TARGET'] == "ia32"): 199 201 gnu_target = "i686-pc-linux-gnu" 200 202 clang_target = "i386-unknown-linux" 203 helenos_target = "i686-pc-helenos" 201 204 202 205 if (config['CROSS_TARGET'] == "mips32"): 203 206 gnu_target = "mipsel-linux-gnu" 204 207 clang_target = "mipsel-unknown-linux" 208 helenos_target = "mipsel-helenos" 205 209 common['CC_ARGS'].append("-mabi=32") 206 210 … … 209 213 gnu_target = "amd64-linux-gnu" 210 214 clang_target = "x86_64-unknown-linux" 215 helenos_target = "amd64-helenos" 211 216 212 217 if (config['PLATFORM'] == "arm32"): … … 214 219 gnu_target = "arm-linux-gnueabi" 215 220 clang_target = "arm-unknown-linux" 221 helenos_target = "arm-helenos-gnueabi" 216 222 217 223 if (config['PLATFORM'] == "ia32"): … … 219 225 gnu_target = "i686-pc-linux-gnu" 220 226 clang_target = "i386-unknown-linux" 227 helenos_target = "i686-pc-helenos" 221 228 222 229 if (config['PLATFORM'] == "ia64"): 223 230 target = config['PLATFORM'] 224 231 gnu_target = "ia64-pc-linux-gnu" 232 helenos_target = "ia64-pc-helenos" 225 233 226 234 if (config['PLATFORM'] == "mips32"): … … 232 240 gnu_target = "mipsel-linux-gnu" 233 241 clang_target = "mipsel-unknown-linux" 242 helenos_target = "mipsel-helenos" 234 243 235 244 if ((config['MACHINE'] == "bmalta")): … … 237 246 gnu_target = "mips-linux-gnu" 238 247 clang_target = "mips-unknown-linux" 248 helenos_target = "mips-helenos" 239 249 240 250 if (config['PLATFORM'] == "mips64"): … … 246 256 gnu_target = "mips64el-linux-gnu" 247 257 clang_target = "mips64el-unknown-linux" 258 helenos_target = "mips64el-helenos" 248 259 249 260 if (config['PLATFORM'] == "ppc32"): … … 251 262 gnu_target = "ppc-linux-gnu" 252 263 clang_target = "powerpc-unknown-linux" 264 helenos_target = "ppc-helenos" 253 265 254 266 if (config['PLATFORM'] == "sparc64"): … … 256 268 gnu_target = "sparc64-linux-gnu" 257 269 clang_target = "sparc-unknown-linux" 258 259 return (target, cc_args, gnu_target, clang_target) 270 helenos_target = "sparc64-helenos" 271 272 return (target, cc_args, gnu_target, clang_target, helenos_target) 260 273 261 274 def check_app(args, name, details): … … 697 710 cross_prefix = "/usr/local/cross" 698 711 712 # HelenOS cross-compiler prefix 713 if ('CROSS_HELENOS_PREFIX' in os.environ): 714 cross_helenos_prefix = os.environ['CROSS_HELENOS_PREFIX'] 715 else: 716 cross_helenos_prefix = "/usr/local/cross-helenos" 717 699 718 # Prefix binutils tools on Solaris 700 719 if (os.uname()[0] == "SunOS"): … … 719 738 common['CC_ARGS'] = [] 720 739 if (config['COMPILER'] == "gcc_cross"): 721 target, cc_args, gnu_target, clang_target = get_target(config)740 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 722 741 723 742 if (target is None) or (gnu_target is None): … … 727 746 path = "%s/%s/bin" % (cross_prefix, target) 728 747 prefix = "%s-" % gnu_target 748 749 check_gcc(path, prefix, common, PACKAGE_CROSS) 750 check_binutils(path, prefix, common, PACKAGE_CROSS) 751 752 check_common(common, "GCC") 753 common['CC'] = common['GCC'] 754 common['CC_ARGS'].extend(cc_args) 755 756 if (config['COMPILER'] == "gcc_helenos"): 757 target, cc_args, gnu_target, clang_target, helenos_target = get_target(config) 758 759 if (target is None) or (helenos_target is None): 760 print_error(["Unsupported compiler target for GNU GCC.", 761 "Please contact the developers of HelenOS."]) 762 763 path = "%s/%s/bin" % (cross_helenos_prefix, target) 764 prefix = "%s-" % helenos_target 729 765 730 766 check_gcc(path, prefix, common, PACKAGE_CROSS) -
tools/toolchain.sh
r39bcc99 r0c96e6cb 55 55 BINUTILS_VERSION="2.23.1" 56 56 BINUTILS_RELEASE="" 57 BINUTILS_PATCHES="toolchain-binutils-2.23.1.patch" 57 58 GCC_VERSION="4.8.1" 59 GCC_PATCHES="toolchain-gcc-4.8.1-targets.patch toolchain-gcc-4.8.1-headers.patch" 58 60 GDB_VERSION="7.6.1" 61 GDB_PATCHES="toolchain-gdb-7.6.1.patch" 59 62 60 63 BASEDIR="`pwd`" … … 62 65 GCC="gcc-${GCC_VERSION}.tar.bz2" 63 66 GDB="gdb-${GDB_VERSION}.tar.bz2" 67 68 REAL_INSTALL=true 69 USE_HELENOS_TARGET=false 70 INSTALL_DIR="${BASEDIR}/PKG" 64 71 65 72 # … … 135 142 echo 136 143 echo "Syntax:" 137 echo " $0 <platform>"144 echo " $0 [--no-install] [--helenos-target] <platform>" 138 145 echo 139 146 echo "Possible target platforms are:" … … 152 159 echo " 2-way same as 'all', but 2-way parallel" 153 160 echo 154 echo "The toolchain will be installed to the directory specified by" 155 echo "the CROSS_PREFIX environment variable. If the variable is not" 156 echo "defined, /usr/local/cross will be used by default." 161 echo "The toolchain is installed into directory specified by the" 162 echo "CROSS_PREFIX environment variable. If the variable is not" 163 echo "defined, /usr/local/cross/ is used as default." 164 echo 165 echo "If --no-install is present, the toolchain still uses the" 166 echo "CROSS_PREFIX as the target directory but the installation" 167 echo "copies the files into PKG/ subdirectory without affecting" 168 echo "the actual root file system. That is only useful if you do" 169 echo "not want to run the script under the super user." 170 echo 171 echo "The --helenos-target will build HelenOS-specific toolchain" 172 echo "(i.e. it will use *-helenos-* triplet instead of *-linux-*)." 173 echo "This toolchain is installed into /usr/local/cross-helenos by" 174 echo "default. The settings can be changed by setting environment" 175 echo "variable CROSS_HELENOS_PREFIX." 176 echo "Using the HelenOS-specific toolchain is still an experimental" 177 echo "feature that is not fully supported." 157 178 echo 158 179 … … 292 313 } 293 314 315 patch_sources() { 316 PATCH_FILE="$1" 317 PATCH_STRIP="$2" 318 DESC="$3" 319 320 change_title "Patching ${DESC}" 321 echo " >>> Patching ${DESC} with ${PATCH_FILE}" 322 323 patch -t "-p${PATCH_STRIP}" <"$PATCH_FILE" 324 check_error $? "Error patching ${DESC}." 325 } 326 294 327 prepare() { 295 328 show_dependencies … … 306 339 } 307 340 341 set_target_from_platform() { 342 case "$1" in 343 "amd64") 344 LINUX_TARGET="amd64-linux-gnu" 345 HELENOS_TARGET="amd64-helenos" 346 ;; 347 "arm32") 348 LINUX_TARGET="arm-linux-gnueabi" 349 HELENOS_TARGET="arm-helenos-gnueabi" 350 ;; 351 "ia32") 352 LINUX_TARGET="i686-pc-linux-gnu" 353 HELENOS_TARGET="i686-pc-helenos" 354 ;; 355 "ia64") 356 LINUX_TARGET="ia64-pc-linux-gnu" 357 HELENOS_TARGET="ia64-pc-helenos" 358 ;; 359 "mips32") 360 LINUX_TARGET="mipsel-linux-gnu" 361 HELENOS_TARGET="mipsel-helenos" 362 ;; 363 "mips32eb") 364 LINUX_TARGET="mips-linux-gnu" 365 HELENOS_TARGET="mips-helenos" 366 ;; 367 "mips64") 368 LINUX_TARGET="mips64el-linux-gnu" 369 HELENOS_TARGET="mips64el-helenos" 370 ;; 371 "ppc32") 372 LINUX_TARGET="ppc-linux-gnu" 373 HELENOS_TARGET="ppc-helenos" 374 ;; 375 "ppc64") 376 LINUX_TARGET="ppc64-linux-gnu" 377 HELENOS_TARGET="ppc64-helenos" 378 ;; 379 "sparc64") 380 LINUX_TARGET="sparc64-linux-gnu" 381 HELENOS_TARGET="sparc64-helenos" 382 ;; 383 *) 384 check_error 1 "No target known for $1." 385 ;; 386 esac 387 } 388 308 389 build_target() { 309 390 PLATFORM="$1" 310 TARGET="$2" 391 # This sets the *_TARGET variables 392 set_target_from_platform "$PLATFORM" 393 if $USE_HELENOS_TARGET; then 394 TARGET="$HELENOS_TARGET" 395 else 396 TARGET="$LINUX_TARGET" 397 fi 311 398 312 399 WORKDIR="${BASEDIR}/${PLATFORM}" … … 319 406 CROSS_PREFIX="/usr/local/cross" 320 407 fi 321 322 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 408 if [ -z "${CROSS_HELENOS_PREFIX}" ] ; then 409 CROSS_HELENOS_PREFIX="/usr/local/cross-helenos" 410 fi 411 412 if $USE_HELENOS_TARGET; then 413 PREFIX="${CROSS_HELENOS_PREFIX}/${PLATFORM}" 414 else 415 PREFIX="${CROSS_PREFIX}/${PLATFORM}" 416 fi 323 417 324 418 echo ">>> Downloading tarballs" … … 328 422 329 423 echo ">>> Removing previous content" 330 cleanup_dir "${PREFIX}"424 $REAL_INSTALL && cleanup_dir "${PREFIX}" 331 425 cleanup_dir "${WORKDIR}" 332 426 333 create_dir "${PREFIX}" "destination directory"427 $REAL_INSTALL && create_dir "${PREFIX}" "destination directory" 334 428 create_dir "${OBJDIR}" "GCC object directory" 335 429 … … 344 438 unpack_tarball "${BASEDIR}/${GDB}" "GDB" 345 439 440 echo ">>> Applying patches" 441 for p in $BINUTILS_PATCHES; do 442 patch_sources "${BASEDIR}/${p}" 0 "binutils" 443 done 444 for p in $GCC_PATCHES; do 445 patch_sources "${BASEDIR}/${p}" 0 "GCC" 446 done 447 for p in $GDB_PATCHES; do 448 patch_sources "${BASEDIR}/${p}" 0 "GDB" 449 done 450 346 451 echo ">>> Processing binutils (${PLATFORM})" 347 452 cd "${BINUTILSDIR}" … … 349 454 350 455 change_title "binutils: configure (${PLATFORM})" 351 CFLAGS=-Wno-error ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --disable-nls --disable-werror 456 CFLAGS=-Wno-error ./configure \ 457 "--target=${TARGET}" \ 458 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 459 --disable-nls --disable-werror 352 460 check_error $? "Error configuring binutils." 353 461 354 462 change_title "binutils: make (${PLATFORM})" 355 make all install 356 check_error $? "Error compiling/installing binutils." 463 make all 464 check_error $? "Error compiling binutils." 465 466 change_title "binutils: install (${PLATFORM})" 467 if $REAL_INSTALL; then 468 make install 469 else 470 make install "DESTDIR=${INSTALL_DIR}" 471 fi 472 check_error $? "Error installing binutils." 473 357 474 358 475 echo ">>> Processing GCC (${PLATFORM})" … … 361 478 362 479 change_title "GCC: configure (${PLATFORM})" 363 "${GCCDIR}/configure" "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" --with-gnu-as --with-gnu-ld --disable-nls --disable-threads --enable-languages=c,objc,c++,obj-c++ --disable-multilib --disable-libgcj --without-headers --disable-shared --enable-lto --disable-werror 480 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" "${GCCDIR}/configure" \ 481 "--target=${TARGET}" \ 482 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" \ 483 --with-gnu-as --with-gnu-ld --disable-nls --disable-threads \ 484 --enable-languages=c,objc,c++,obj-c++ \ 485 --disable-multilib --disable-libgcj --without-headers \ 486 --disable-shared --enable-lto --disable-werror 364 487 check_error $? "Error configuring GCC." 365 488 366 489 change_title "GCC: make (${PLATFORM})" 367 PATH="${PATH}:${PREFIX}/bin" make all-gcc install-gcc 368 check_error $? "Error compiling/installing GCC." 490 PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all-gcc 491 check_error $? "Error compiling GCC." 492 493 change_title "GCC: install (${PLATFORM})" 494 if $REAL_INSTALL; then 495 PATH="${PATH}:${PREFIX}/bin" make install-gcc 496 else 497 PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install-gcc "DESTDIR=${INSTALL_DIR}" 498 fi 499 check_error $? "Error installing GCC." 500 369 501 370 502 echo ">>> Processing GDB (${PLATFORM})" … … 373 505 374 506 change_title "GDB: configure (${PLATFORM})" 375 ./configure "--target=${TARGET}" "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 507 PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" ./configure \ 508 "--target=${TARGET}" \ 509 "--prefix=${PREFIX}" "--program-prefix=${TARGET}-" 376 510 check_error $? "Error configuring GDB." 377 511 378 512 change_title "GDB: make (${PLATFORM})" 379 make all install 380 check_error $? "Error compiling/installing GDB." 513 PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all 514 check_error $? "Error compiling GDB." 515 516 change_title "GDB: make (${PLATFORM})" 517 if $REAL_INSTALL; then 518 PATH="${PATH}:${PREFIX}/bin" make install 519 else 520 PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install "DESTDIR=${INSTALL_DIR}" 521 fi 522 check_error $? "Error installing GDB." 523 381 524 382 525 cd "${BASEDIR}" … … 389 532 echo ">>> Cross-compiler for ${TARGET} installed." 390 533 } 534 535 while [ "$#" -gt 1 ]; do 536 case "$1" in 537 --no-install) 538 REAL_INSTALL=false 539 shift 540 ;; 541 --helenos-target) 542 USE_HELENOS_TARGET=true 543 shift 544 ;; 545 *) 546 show_usage 547 ;; 548 esac 549 done 391 550 392 551 if [ "$#" -lt "1" ]; then … … 395 554 396 555 case "$1" in 397 "amd64")556 amd64|arm32|ia32|ia64|mips32|mips32eb|mips64|ppc32|ppc64|sparc64) 398 557 prepare 399 build_target "amd64" "amd64-linux-gnu" 400 ;; 401 "arm32") 402 prepare 403 build_target "arm32" "arm-linux-gnueabi" 404 ;; 405 "ia32") 406 prepare 407 build_target "ia32" "i686-pc-linux-gnu" 408 ;; 409 "ia64") 410 prepare 411 build_target "ia64" "ia64-pc-linux-gnu" 412 ;; 413 "mips32") 414 prepare 415 build_target "mips32" "mipsel-linux-gnu" 416 ;; 417 "mips32eb") 418 prepare 419 build_target "mips32eb" "mips-linux-gnu" 420 ;; 421 "mips64") 422 prepare 423 build_target "mips64" "mips64el-linux-gnu" 424 ;; 425 "ppc32") 426 prepare 427 build_target "ppc32" "ppc-linux-gnu" 428 ;; 429 "ppc64") 430 prepare 431 build_target "ppc64" "ppc64-linux-gnu" 432 ;; 433 "sparc64") 434 prepare 435 build_target "sparc64" "sparc64-linux-gnu" 558 build_target "$1" 436 559 ;; 437 560 "all") 438 561 prepare 439 build_target "amd64" "amd64-linux-gnu"440 build_target "arm32" "arm-linux-gnueabi"441 build_target "ia32" "i686-pc-linux-gnu"442 build_target "ia64" "ia64-pc-linux-gnu"443 build_target "mips32" "mipsel-linux-gnu"444 build_target "mips32eb" "mips-linux-gnu"445 build_target "mips64" "mips64el-linux-gnu"446 build_target "ppc32" "ppc-linux-gnu"447 build_target "ppc64" "ppc64-linux-gnu"448 build_target "sparc64" "sparc64-linux-gnu"562 build_target "amd64" 563 build_target "arm32" 564 build_target "ia32" 565 build_target "ia64" 566 build_target "mips32" 567 build_target "mips32eb" 568 build_target "mips64" 569 build_target "ppc32" 570 build_target "ppc64" 571 build_target "sparc64" 449 572 ;; 450 573 "parallel") 451 574 prepare 452 build_target "amd64" "amd64-linux-gnu"&453 build_target "arm32" "arm-linux-gnueabi"&454 build_target "ia32" "i686-pc-linux-gnu"&455 build_target "ia64" "ia64-pc-linux-gnu"&456 build_target "mips32" "mipsel-linux-gnu"&457 build_target "mips32eb" "mips-linux-gnu"&458 build_target "mips64" "mips64el-linux-gnu"&459 build_target "ppc32" "ppc-linux-gnu"&460 build_target "ppc64" "ppc64-linux-gnu"&461 build_target "sparc64" "sparc64-linux-gnu"&575 build_target "amd64" & 576 build_target "arm32" & 577 build_target "ia32" & 578 build_target "ia64" & 579 build_target "mips32" & 580 build_target "mips32eb" & 581 build_target "mips64" & 582 build_target "ppc32" & 583 build_target "ppc64" & 584 build_target "sparc64" & 462 585 wait 463 586 ;; 464 587 "2-way") 465 588 prepare 466 build_target "amd64" "amd64-linux-gnu"&467 build_target "arm32" "arm-linux-gnueabi"&589 build_target "amd64" & 590 build_target "arm32" & 468 591 wait 469 592 470 build_target "ia32" "i686-pc-linux-gnu"&471 build_target "ia64" "ia64-pc-linux-gnu"&593 build_target "ia32" & 594 build_target "ia64" & 472 595 wait 473 596 474 build_target "mips32" "mipsel-linux-gnu"&475 build_target "mips32eb" "mips-linux-gnu"&597 build_target "mips32" & 598 build_target "mips32eb" & 476 599 wait 477 600 478 build_target "mips64" "mips64el-linux-gnu"&479 build_target "ppc32" "ppc-linux-gnu"&601 build_target "mips64" & 602 build_target "ppc32" & 480 603 wait 481 604 482 build_target "ppc64" "ppc64-linux-gnu"&483 build_target "sparc64" "sparc64-linux-gnu"&605 build_target "ppc64" & 606 build_target "sparc64" & 484 607 wait 485 608 ;; -
uspace/Makefile.common
r39bcc99 r0c96e6cb 248 248 endif 249 249 250 ifeq ($(COMPILER),gcc_helenos) 251 CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS) 252 DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) 253 endif 254 250 255 ifeq ($(COMPILER),gcc_native) 251 256 CFLAGS += $(GCC_CFLAGS) $(EXTRA_CFLAGS) -
uspace/lib/c/generic/bitops.c
r39bcc99 r0c96e6cb 33 33 #include <bitops.h> 34 34 35 externint __popcountsi2(int a)35 int __popcountsi2(int a) 36 36 { 37 return __builtin_popcount(a); 37 int bits = 0; 38 for (unsigned int i = 0; i < sizeof(a) * 8; i++) { 39 if (((a >> i) & 1) != 0) { 40 bits++; 41 } 42 } 43 return bits; 38 44 } 39 45 -
uspace/lib/posix/Makefile
r39bcc99 r0c96e6cb 42 42 FIXED_C_LIBRARY = libc4posix.a 43 43 44 REDEFS_HIDE_LIBC = redefs-hide-libc .xargs45 REDEFS_SHOW_LIBPOSIX = redefs-show-posix .xargs44 REDEFS_HIDE_LIBC = redefs-hide-libc-symbols.list 45 REDEFS_SHOW_LIBPOSIX = redefs-show-posix-symbols.list 46 46 COLLISIONS_LIST = collisions.list 47 47 … … 61 61 source/locale.c \ 62 62 source/math.c \ 63 source/pthread/condvar.c \ 64 source/pthread/keys.c \ 65 source/pthread/mutex.c \ 66 source/pthread/threads.c \ 63 67 source/pwd.c \ 64 68 source/signal.c \ … … 81 85 82 86 $(FIXED_C_LIBRARY): $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 83 ./tools/transform-symbols.sh \ 84 $(OBJCOPY) $(AR) echo \ 85 $(LIBC_FILE) $@ \ 86 $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 87 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBC_FILE) $@ 88 $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@ 87 89 88 90 $(FIXED_POSIX_LIBRARY): $(LIBRARY).a $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 89 ./tools/transform-symbols.sh \ 90 $(OBJCOPY) $(AR) echo \ 91 $(LIBRARY).a $@ \ 92 $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 91 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBRARY).a $@ 92 $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@ 93 93 94 94 $(REDEFS_HIDE_LIBC): $(COLLISIONS_LIST) 95 ./tools/create-redefines.sh "" "__helenos_libc_"<$(COLLISIONS_LIST) >$@96 95 sed 's/.*/& __helenos_libc_&/' <$(COLLISIONS_LIST) >$@ 96 97 97 $(REDEFS_SHOW_LIBPOSIX): $(COLLISIONS_LIST) 98 ./tools/create-redefines.sh "posix_" ""<$(COLLISIONS_LIST) >$@98 sed 's/.*/posix_& &/' <$(COLLISIONS_LIST) >$@ 99 99 100 100 $(COLLISIONS_LIST): 101 ./tools/get-collision-list.sh ./include/posix >$@ 101 find ./include/posix -name '*.h' -exec \ 102 sed -n -e '/^#/d' -e 's/__POSIX_DEF__/\n&/gp' {} \; | \ 103 sed -n -e 's/__POSIX_DEF__(\([^)]*\)).*/\1/p' | \ 104 sort -u >$@ -
uspace/lib/posix/include/posix/float.h
r39bcc99 r0c96e6cb 61 61 #undef FLT_RADIX 62 62 #define FLT_RADIX __FLT_RADIX__ 63 #undef FLT_MIN 64 #define FLT_MIN __FLT_MIN__ 65 #undef FLT_MAX 66 #define FLT_MAX __FLT_MAX__ 67 #undef FLT_EPSILON 68 #define FLT_EPSILON __FLT_EPSILON__ 69 #undef FLT_MANT_DIG 70 #define FLT_MANT_DIG __FLT_MANT_DIG__ 71 #undef LDBL_MANT_DIG 72 #define LDBL_MANT_DIG __LDBL_MANT_DIG__ 63 73 #else 64 74 /* For something else than GCC, following definitions are provided. -
uspace/lib/posix/include/posix/stdint.h
r39bcc99 r0c96e6cb 108 108 109 109 110 /* 111 * Fast* and least* integer types. 112 * 113 * The definitions below are definitely safe if not the best. 114 */ 115 typedef uint8_t uint_least8_t; 116 typedef uint16_t uint_least16_t; 117 typedef uint32_t uint_least32_t; 118 typedef uint64_t uint_least64_t; 119 120 typedef int8_t int_least8_t; 121 typedef int16_t int_least16_t; 122 typedef int32_t int_least32_t; 123 typedef int64_t int_least64_t; 124 125 typedef uint8_t uint_fast8_t; 126 typedef uint16_t uint_fast16_t; 127 typedef uint32_t uint_fast32_t; 128 typedef uint64_t uint_fast64_t; 129 130 typedef int8_t int_fast8_t; 131 typedef int16_t int_fast16_t; 132 typedef int32_t int_fast32_t; 133 typedef int64_t int_fast64_t; 134 110 135 #endif /* POSIX_STDINT_H_ */ 111 136 -
uspace/lib/posix/include/posix/stdio.h
r39bcc99 r0c96e6cb 123 123 124 124 extern void setvbuf(FILE *, void *, int, size_t); 125 125 extern void setbuf(FILE *, void *); 126 126 127 127 /* POSIX specific stuff. */ -
uspace/lib/posix/include/posix/time.h
r39bcc99 r0c96e6cb 104 104 extern char *__POSIX_DEF__(ctime_r)(const time_t *timer, char *buf); 105 105 extern char *__POSIX_DEF__(ctime)(const time_t *timer); 106 extern time_t time(time_t *t); 106 107 107 108 /* Clocks */ -
uspace/lib/posix/source/internal/common.h
r39bcc99 r0c96e6cb 39 39 #include <stdlib.h> 40 40 41 #define not_implemented() (fprintf(stderr, \ 42 "Function %s() in file %s at line %d is not implemented\n", \ 43 __func__, __FILE__, __LINE__), abort()) 41 #define not_implemented() do { \ 42 static int __not_implemented_counter = 0; \ 43 if (__not_implemented_counter == 0) { \ 44 fprintf(stderr, "%s() not implemented in %s:%d, something will NOT work.\n", \ 45 __func__, __FILE__, __LINE__); \ 46 } \ 47 __not_implemented_counter++; \ 48 } while (0) 44 49 45 50 /* A little helper macro to avoid typing this over and over. */ -
uspace/lib/posix/source/math.c
r39bcc99 r0c96e6cb 49 49 // TODO: low priority, just a compile-time dependency of binutils 50 50 not_implemented(); 51 return 0.0; 51 52 } 52 53 … … 61 62 // TODO: low priority, just a compile-time dependency of binutils 62 63 not_implemented(); 64 return 0.0; 63 65 } 64 66 … … 72 74 // TODO: Python dependency 73 75 not_implemented(); 76 return 0.0; 74 77 } 75 78 … … 84 87 // TODO: Python dependency 85 88 not_implemented(); 89 return 0.0; 86 90 } 87 91 … … 95 99 // TODO: Python dependency 96 100 not_implemented(); 101 return 0.0; 97 102 } 98 103 … … 106 111 // TODO: Python dependency 107 112 not_implemented(); 113 return 0.0; 108 114 } 109 115 … … 118 124 // TODO: Python dependency 119 125 not_implemented(); 126 return 0.0; 120 127 } 121 128 … … 130 137 // TODO: Python dependency 131 138 not_implemented(); 139 return 0.0; 132 140 } 133 141 … … 141 149 // TODO: Python dependency 142 150 not_implemented(); 151 return 0.0; 143 152 } 144 153 … … 153 162 // TODO: Python dependency 154 163 not_implemented(); 164 return 0.0; 155 165 } 156 166 … … 164 174 // TODO: Python dependency 165 175 not_implemented(); 176 return 0.0; 166 177 } 167 178 … … 175 186 // TODO: Python dependency 176 187 not_implemented(); 188 return 0.0; 177 189 } 178 190 … … 186 198 // TODO: Python dependency 187 199 not_implemented(); 200 return 0.0; 188 201 } 189 202 -
uspace/lib/posix/source/stdlib.c
r39bcc99 r0c96e6cb 63 63 // TODO: low priority, just a compile-time dependency of binutils 64 64 not_implemented(); 65 return 1;65 return 0; 66 66 } 67 67 -
uspace/lib/posix/source/unistd.c
r39bcc99 r0c96e6cb 389 389 // TODO: low priority, just a compile-time dependency of binutils 390 390 not_implemented(); 391 return -1; 391 392 } 392 393 … … 399 400 // TODO: low priority, just a compile-time dependency of binutils 400 401 not_implemented(); 402 return -1; 401 403 } 402 404 … … 411 413 // TODO: low priority, just a compile-time dependency of binutils 412 414 not_implemented(); 415 return -1; 413 416 } 414 417 … … 423 426 // TODO: low priority, just a compile-time dependency of binutils 424 427 not_implemented(); 428 return -1; 425 429 } 426 430 … … 434 438 // TODO: low priority, just a compile-time dependency of binutils 435 439 not_implemented(); 440 return -1; 436 441 } 437 442
Note:
See TracChangeset
for help on using the changeset viewer.