Changeset dfeb4e2 in mainline
- Timestamp:
- 2018-01-06T02:37:59Z (7 years ago)
- Children:
- c9e09f2
- Parents:
- 3d95c9d
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-02 18:06:21)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-06 02:37:59)
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r3d95c9d rdfeb4e2 60 60 uspace: common 61 61 $(MAKE) -r -C uspace PRECHECK=$(PRECHECK) 62 63 ports-%: common 64 $(MAKE) -r -C uspace $@ PRECHECK=$(PRECHECK) 62 65 63 66 precheck: clean -
tools/autotool.py
r3d95c9d rdfeb4e2 615 615 path = "%s/%s/bin" % (cross_prefix, platform) 616 616 617 common['TARGET'] = target 617 618 prefix = "%s-" % target 618 619 -
uspace/Makefile
r3d95c9d rdfeb4e2 255 255 CLEANS := $(addsuffix .clean,$(DIRS) $(LIBS) $(BASE_LIBS)) 256 256 257 .PHONY: all $(BASE_BUILDS) $(BUILDS) $(BUILDS_TESTS) $(CLEANS) clean 257 PORTS_BUILD_DIR := ../build/ports 258 PORT_CFLAGS := \ 259 -specs $(abspath lib/posix/gcc.specs) \ 260 -isystem $(abspath $(PORTS_BUILD_DIR)/include) \ 261 -isystem $(abspath $(PORTS_BUILD_DIR)/include/posix) \ 262 -isystem $(abspath $(PORTS_BUILD_DIR)/include/libc) \ 263 -L$(abspath $(PORTS_BUILD_DIR)/lib) \ 264 -Wl,-T,link.ld \ 265 -Wl,--whole-archive,-lc,-lmath,--no-whole-archive 266 267 .PHONY: all $(BASE_BUILDS) $(BUILDS) $(BUILDS_TESTS) $(CLEANS) clean ports_cache 258 268 259 269 all: $(BUILDS) $(BUILDS_TESTS) 270 271 ports_cache: lib/posix.build lib/math.build lib/clui.build 272 git submodule update --init -- ports 273 274 # Copy libs 275 mkdir -p $(PORTS_BUILD_DIR)/lib 276 cp lib/posix/link.ld $(PORTS_BUILD_DIR)/lib/link.ld 277 cp lib/posix/libc.a $(PORTS_BUILD_DIR)/lib/libc.a 278 # We don't currently build a dedicated debug-enabled libc version. 279 cp lib/posix/libc.a $(PORTS_BUILD_DIR)/lib/libg.a 280 cp lib/math/libmath.a $(PORTS_BUILD_DIR)/lib/libmath.a 281 cp lib/clui/libclui.a $(PORTS_BUILD_DIR)/lib/libclui.a 282 283 # Copy headers 284 mkdir -p $(PORTS_BUILD_DIR)/include 285 cp -L -R lib/posix/include/posix/ $(PORTS_BUILD_DIR)/include/ 286 mkdir -p $(PORTS_BUILD_DIR)/include/libc 287 cp -L -R lib/c/include/* $(PORTS_BUILD_DIR)/include/libc 288 cp -L -R lib/c/arch/$(UARCH)/include/libarch $(PORTS_BUILD_DIR)/include/ 289 cp -L -R lib/math/include/* $(PORTS_BUILD_DIR)/include/libc 290 cp -L -R lib/math/arch/$(UARCH)/include/libarch/ $(PORTS_BUILD_DIR)/include/ 291 cp -L -R ../abi/include/* $(PORTS_BUILD_DIR)/include/ 292 ln -s -f -n libc $(PORTS_BUILD_DIR)/include/libmath 293 294 # FIXME: Just for temporary compatibility. 295 touch $(PORTS_BUILD_DIR)/coastline.specs 296 297 mkdir -p $(PORTS_BUILD_DIR)/include/libclui 298 cp -L lib/clui/tinput.h $(PORTS_BUILD_DIR)/include/libclui/ 299 300 # TODO: Get rid of this. 301 find $(PORTS_BUILD_DIR)/include/libc $(PORTS_BUILD_DIR)/include/libarch -name '*.h' -exec sed \ 302 -e 's:#include <:#include <libc/:' \ 303 -e 's:#include <libc/libarch/:#include <libarch/:' \ 304 -e 's:#include <libc/abi/:#include <abi/:' \ 305 -e 's:#include <libc/_bits/:#include <_bits/:' \ 306 -e 's:#include <libc/libc/:#include <libc/:' \ 307 -i {} \; 308 309 mkdir -p overlay 310 311 ports-all: ports_cache 312 for x in ports/*; do if [ -d "$$x" ]; then $(MAKE) ports-install-`basename $$x` || exit 1; fi; done 313 314 ports-%: ports_cache 315 $(MAKE) $(@:ports-%=ports-install-%) 316 317 # This is a separate target to avoid running ports_cache multiple times. 318 ports-install-%: 319 PATH="$(CROSS_PREFIX)/$(TARGET)/bin:$$PATH" \ 320 HSCT_HELENOS_ROOT="$(abspath ..)" \ 321 HSCT_HOME="$(abspath ports)" \ 322 HSCT_HSCT="$(abspath ../tools/hsct.sh)" \ 323 HSCT_SOURCES_DIR="$(abspath $(PORTS_BUILD_DIR)/sources)" \ 324 HSCT_BUILD_DIR="$(abspath $(PORTS_BUILD_DIR)/build)" \ 325 HSCT_INCLUDE_DIR="$(abspath $(PORTS_BUILD_DIR)/include)" \ 326 HSCT_LIB_DIR="$(abspath $(PORTS_BUILD_DIR)/lib)" \ 327 HSCT_CACHE_DIR="$(abspath $(PORTS_BUILD_DIR))" \ 328 HSCT_CACHE_LIB="$(abspath $(PORTS_BUILD_DIR)/lib)" \ 329 HSCT_DIST_DIR="$(abspath $(PORTS_BUILD_DIR)/dist)" \ 330 HSCT_ARCHIVE_DIR="$(abspath $(PORTS_BUILD_DIR)/archives)" \ 331 HSCT_PARALLELISM="$(JOBS)" \ 332 HSCT_GNU_TARGET="$(TARGET)" \ 333 HSCT_CC="$(CC) $(PORT_CFLAGS)" \ 334 HSCT_CFLAGS="" \ 335 HSCT_LDFLAGS_FOR_CC="" \ 336 HSCT_LD="$(LD)" \ 337 HSCT_AR="$(AR)" \ 338 HSCT_RANLIB="$(RANLIB)" \ 339 HSCT_OBJDUMP="$(OBJDUMP)" \ 340 HSCT_OBJCOPY="$(OBJCOPY)" \ 341 HSCT_AS="$(AS)" \ 342 HSCT_STRIP="$(STRIP)" \ 343 ../tools/hsct.sh install $(@:ports-install-%=%) 260 344 261 345 $(BUILDS_TESTS): $(BASE_BUILDS) $(BUILDS) -
uspace/Makefile.common
r3d95c9d rdfeb4e2 174 174 endif 175 175 176 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ 177 -ffreestanding -fno-builtin -nostdlib -nostdinc -fexec-charset=UTF-8 \ 178 -finput-charset=UTF-8 -D__$(ENDIANESS)__ -fno-common \ 176 # Flags that are not necessary, and can be overriden, but are used by default. 177 DEFAULT_CFLAGS = \ 178 -O$(OPTIMIZATION) \ 179 -ffunction-sections \ 180 -pipe \ 181 -Wall \ 182 -Wextra \ 183 -Wno-unused-parameter \ 184 -Wmissing-prototypes \ 185 -Wwrite-strings \ 186 -Werror-implicit-function-declaration 187 188 ifeq ($(CONFIG_DEBUG),y) 189 DEFAULT_CFLAGS += -Werror 190 endif 191 192 ifeq ($(COMPILER),clang) 193 DEFAULT_CFLAGS += \ 194 -Wno-missing-field-initializers \ 195 -Wno-typedef-redefinition \ 196 -Wno-unused-command-line-argument 197 else 198 DEFAULT_CFLAGS += \ 199 -Wno-clobbered 200 endif 201 202 ifeq ($(CONFIG_LINE_DEBUG),y) 203 DEFAULT_CFLAGS += -ggdb 204 endif 205 206 # Flags that should always be used, even for third-party software. 207 COMMON_CFLAGS = \ 208 -ffreestanding \ 209 -fno-builtin \ 210 -nostdlib \ 211 -nostdinc \ 212 -D__$(ENDIANESS)__ 213 214 # Flags that are always used for HelenOS code, but not for third-party. 215 HELENOS_CFLAGS = \ 216 -std=gnu99 \ 217 $(INCLUDES_FLAGS) \ 218 -imacros $(CONFIG_HEADER) \ 219 -fexec-charset=UTF-8 \ 220 -finput-charset=UTF-8 \ 221 -fno-common \ 179 222 -fdebug-prefix-map=$(realpath $(ROOT_PATH))=. 180 223 181 GCC_CFLAGS = -ffunction-sections -Wall -Wextra -Wno-clobbered \ 182 -Wno-unused-parameter -Wmissing-prototypes -std=gnu99 \ 183 -Werror-implicit-function-declaration \ 184 -Wwrite-strings -pipe 185 186 # -Wno-missing-prototypes is there because it warns about main(). 187 # This should be fixed elsewhere. 188 CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-typedef-redefinition \ 189 -Wno-missing-prototypes -Wno-unused-command-line-argument \ 190 -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \ 191 -pipe -fno-stack-protector -fno-PIC 192 193 ifeq ($(CONFIG_DEBUG),y) 194 COMMON_CFLAGS += -Werror 195 endif 196 197 ifeq ($(CONFIG_LINE_DEBUG),y) 198 GCC_CFLAGS += -ggdb 199 CLANG_CFLAGS += -g 200 endif 224 # TODO: Use a different name. 225 # CFLAGS variable is traditionally used for overridable flags. 226 CFLAGS = $(COMMON_CFLAGS) $(HELENOS_CFLAGS) $(DEFAULT_CFLAGS) 201 227 202 228 ## Setup platform configuration … … 214 240 else 215 241 CC_JOB = $(CC) $< -o $@ 216 endif217 218 ifeq ($(COMPILER),clang)219 CFLAGS += $(COMMON_CFLAGS) $(CLANG_CFLAGS)220 else221 CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)222 242 endif 223 243 -
uspace/lib/c/Makefile
r3d95c9d rdfeb4e2 44 44 LIBRARY = libc 45 45 SOVERSION = 0.0 46 47 EXTRA_CFLAGS = -fno-builtin 46 48 47 49 -include $(CONFIG_MAKEFILE) -
uspace/lib/c/arch/amd64/Makefile.common
r3d95c9d rdfeb4e2 31 31 # XXX: clang doesn't support this flag, but the optimization is OS-specific, 32 32 # so it isn't used for amd64-unknown-elf target. 33 GCC_CFLAGS += -mno-tls-direct-seg-refs 33 34 ifneq ($(COMPILER),clang) 35 COMMON_CFLAGS += -mno-tls-direct-seg-refs 36 endif 34 37 35 38 LFLAGS += --gc-sections -
uspace/lib/posix/Makefile
r3d95c9d rdfeb4e2 46 46 $(LIBSOFTINT_PREFIX)/libsoftint.a 47 47 48 SPECS = gcc.specs 49 LINKER_SCRIPT = link.ld 50 STARTUP_FILE = crt0.o 51 LIBC_LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld 52 LIBC_STARTUP_FILE = $(LIBC_PREFIX)/arch/$(UARCH)/src/entry.o 53 48 54 REDEFS_HIDE_LIBC = redefs-hide-libc-symbols.list 49 55 REDEFS_SHOW_LIBPOSIX = redefs-show-posix-symbols.list … … 58 64 libc.o 59 65 60 EXTRA_OUTPUT = $(FIXED_C_LIBRARY) $(FIXED_POSIX_LIBRARY) $(MERGED_C_LIBRARY) 66 EXTRA_OUTPUT = $(FIXED_C_LIBRARY) $(FIXED_POSIX_LIBRARY) $(MERGED_C_LIBRARY) $(SPECS) $(LINKER_SCRIPT) $(STARTUP_FILE) 61 67 62 68 SOURCES = \ … … 92 98 include $(USPACE_PREFIX)/Makefile.common 93 99 100 $(SPECS): $(CONFIG_MAKEFILE) 101 echo '*self_spec:' > $@.new 102 echo '+ $(COMMON_CFLAGS)' >> $@.new 103 echo >> $@.new 104 echo '*lib:' >> $@.new 105 echo '--whole-archive -lc -lm --no-whole-archive' >> $@.new 106 echo >> $@.new 107 mv $@.new $@ 108 109 $(LINKER_SCRIPT): $(LIBC_LINKER_SCRIPT) 110 cp $< $@ 111 112 $(STARTUP_FILE): $(LIBC_STARTUP_FILE) 113 cp $< $@ 114 94 115 $(INCLUDE_LIBC): ../c/include 95 116 ln -s -f -n ../$^ $@ -
uspace/lib/posix/include/posix/stdio.h
r3d95c9d rdfeb4e2 72 72 typedef struct _IO_FILE FILE; 73 73 74 #if ndef LIBPOSIX_INTERNAL74 #if !defined(LIBPOSIX_INTERNAL) && !defined(LIBC_STDIO_H_) 75 75 enum _buffer_type { 76 76 /** No buffering */
Note:
See TracChangeset
for help on using the changeset viewer.