Add fPIC option to so compilation. 55/137055/1
authoru.harbuz <u.harbuz@samsung.com>
Thu, 4 May 2017 13:22:00 +0000 (15:22 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Tue, 4 Jul 2017 08:26:06 +0000 (10:26 +0200)
Change-Id: Ibe88c4bc2625b76c3449c574d35dc93cf2c4aa2c

build/TEECLib/src/subdir.mk
build/log/subdir.mk
build/osal/subdir.mk

index 1af650e..5bdd5c9 100755 (executable)
@@ -11,12 +11,13 @@ C_DEPS += \
 ./src/teec_api.d \
 ./src/teec_connection.d 
 
+C_FLAGS += -fPIC
 
 # Each subdirectory must supply rules for building sources it contributes
 src/%.o: $(TEECLIB_SOURCE)/src/%.c
        @echo 'Building file: $<'
        @echo 'Invoking: GCC C Compiler'
-       $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+       $(TOOLCHAIN)g++ $(C_FLAGS) -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
        @echo 'Finished building: $<'
        @echo ' '
 
index 354843c..42ea68f 100755 (executable)
@@ -8,11 +8,13 @@ OBJS += \
 C_DEPS += \
 ./log.d 
 
+C_FLAGS += -fPIC
+
 # Each subdirectory must supply rules for building sources it contributes
 %.o: $(LOG_SOURCE)/%.c
        @echo 'Building file: $<'
        @echo 'Invoking: GCC C Compiler'
-       $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+       $(TOOLCHAIN)g++ $(C_FLAGS) -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
        @echo 'Finished building: $<'
        @echo ' '
 
index 4f05c36..f508fed 100755 (executable)
@@ -23,12 +23,13 @@ C_DEPS += \
 ./OsaSignal.d \
 ./OsaTask.d 
 
+C_FLAGS += -fPIC
 
 # Each subdirectory must supply rules for building sources it contributes
 %.o: $(OSAL_SOURCE)/%.c
        @echo 'Building file: $<'
        @echo 'Invoking: GCC C Compiler'
-       $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+       $(TOOLCHAIN)g++ $(C_FLAGS) -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
        @echo 'Finished building: $<'
        @echo ' '