Changeset ea42e44 in mainline


Ignore:
Timestamp:
2018-02-08T19:33:49Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8192d8a
Parents:
2660ee3
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-07 18:23:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-08 19:33:49)
Message:

Third party build improvements.

Add HELENOS_ARCH, HELENOS_CXXFLAGS and HELENOS_LDLIBS variables,
split CPPFLAGS from CFLAGS, split LDLIBS from LDFLAGS.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    r2660ee3 rea42e44  
    205205
    206206# Flags that should always be used, even for third-party software.
     207COMMON_CPPFLAGS = \
     208        -nostdinc \
     209        -D__$(ENDIANESS)__
     210
    207211COMMON_CFLAGS = \
    208212        -ffreestanding \
    209         -nostdlib \
    210         -nostdinc \
    211         -D__$(ENDIANESS)__
     213        -nostdlib
    212214
    213215# Flags that are always used for HelenOS code, but not for third-party.
     
    224226# TODO: Use a different name.
    225227# CFLAGS variable is traditionally used for overridable flags.
    226 CFLAGS = $(COMMON_CFLAGS) $(HELENOS_CFLAGS) $(DEFAULT_CFLAGS)
     228CFLAGS = $(COMMON_CPPFLAGS) $(COMMON_CFLAGS) $(HELENOS_CFLAGS) $(DEFAULT_CFLAGS)
    227229
    228230## Setup platform configuration
  • uspace/lib/posix/Makefile

    r2660ee3 rea42e44  
    103103EXPORT_LDFLAGS = \
    104104        -L$$(HELENOS_EXPORT_ROOT)/lib \
    105         --whole-archive -lc -lmath --no-whole-archive \
    106105        -T link.ld
    107106
     107EXPORT_LDLIBS = \
     108        -lmath -lc
     109
    108110EXPORT_CFLAGS = \
    109         $(EXPORT_CPPFLAGS) \
    110         $(addprefix -Xlinker , $(EXPORT_LDFLAGS))
     111        -specs $$(HELENOS_EXPORT_ROOT)/lib/gcc.specs
    111112
    112113include $(USPACE_PREFIX)/Makefile.common
     
    116117        echo '+ $(COMMON_CFLAGS)' >> $@.new
    117118        echo >> $@.new
     119        echo '*cpp:' >> $@.new
     120        echo '+ $(COMMON_CPPFLAGS)' >> $@.new
     121        echo >> $@.new
    118122        echo '*lib:' >> $@.new
    119         echo '--whole-archive -lc -lmath --no-whole-archive' >> $@.new
    120         echo >> $@.new
     123        echo '$(EXPORT_LDLIBS)' >> $@.new
    121124        mv $@.new $@
    122125
     
    137140        echo '# Do not forget to set HELENOS_EXPORT_ROOT.' >> $@.new
    138141        echo 'HELENOS_CROSS_PATH="$(shell dirname $(CC))"' >> $@.new
     142        echo 'HELENOS_ARCH="$(firstword $(subst -, ,$(TARGET)))"' >> $@.new
    139143        echo 'HELENOS_TARGET="$(TARGET)"' >> $@.new
    140144        echo 'HELENOS_CPPFLAGS="$(EXPORT_CPPFLAGS)"' >> $@.new
    141145        echo 'HELENOS_CFLAGS="$(EXPORT_CFLAGS)"' >> $@.new
     146        echo 'HELENOS_CXXFLAGS="$(EXPORT_CFLAGS)"' >> $@.new
    142147        echo 'HELENOS_LDFLAGS="$(EXPORT_LDFLAGS)"' >> $@.new
     148        echo 'HELENOS_LDLIBS="$(EXPORT_LDLIBS)"' >> $@.new
    143149        mv $@.new $@
    144150
Note: See TracChangeset for help on using the changeset viewer.