Subversion Repositories QNX 8.QNX8 GNU binutils

Rev

Rev 15 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 19
Line 71... Line 71...
71
        # we're not in WSL. We can expect reasonably good file access speeds to the QNX SDP that's bundled with this repository, so just use it.
71
        # we're not in WSL. We can expect reasonably good file access speeds to the QNX SDP that's bundled with this repository, so just use it.
72
        QNXSDK_CANONICAL_PATH="$(realpath "${CURRENT_DIR}/${QNXSDK_PATH}")"
72
        QNXSDK_CANONICAL_PATH="$(realpath "${CURRENT_DIR}/${QNXSDK_PATH}")"
73
fi
73
fi
74
 
74
 
75
# verify that the symlinks are deployed in the SDK -- just test one of them in each relevant directory ($QNX_HOST for the tools, $QNX_TARGET for the sysroot)
75
# verify that the symlinks are deployed in the SDK -- just test one of them in each relevant directory ($QNX_HOST for the tools, $QNX_TARGET for the sysroot)
76
if [ ! -e "${QNXSDK_CANONICAL_PATH}/${QNXSDK_HOSTPATH}/usr/bin/gcc" ] || [ ! -e "${QNXSDK_CANONICAL_PATH}/${QNXSDK_TARGETPATH}/usr/include/readline.h" ]; then
76
if [ ! -e "${QNXSDK_CANONICAL_PATH}/${QNXSDK_HOSTPATH}/usr/bin/ntox86_64-gcc" ] || [ ! -e "${QNXSDK_CANONICAL_PATH}/${QNXSDK_TARGETPATH}/usr/include/readline.h" ]; then
77
        print_error_and_die \
77
        print_error_and_die \
78
                "Error: the toolchain platform-specific symbolic links have not been deployed in this QNX SDK. Please run" \
78
                "Error: the toolchain platform-specific symbolic links have not been deployed in this QNX SDK. Please run" \
79
                "(on a POSIX machine:)" \
79
                "(on a POSIX machine:)" \
80
                "       cd ${QNXSDK_CANONICAL_PATH}" \
80
                "       cd ${QNXSDK_CANONICAL_PATH}" \
81
                "       find . -name symlinks.lst -exec ./symlinks.sh {} create \\; && printf 'present' > .symlinks-state" \
81
                "       find . -name symlinks.lst -exec ./symlinks.sh {} create \\; && printf 'present' > .symlinks-state" \
Line 219... Line 219...
219
backup_and_replace "ld/emulparams/aarch64nto.sh" "${CURRENT_DIR}/ld.emulparams.aarch64nto.sh"
219
backup_and_replace "ld/emulparams/aarch64nto.sh" "${CURRENT_DIR}/ld.emulparams.aarch64nto.sh"
220
 
220
 
221
# patch ld/emulparams/elf_x86_64nto.sh
221
# patch ld/emulparams/elf_x86_64nto.sh
222
# RATIONALE: insert aarch64 QNX particularities for the GNU linker
222
# RATIONALE: insert aarch64 QNX particularities for the GNU linker
223
backup_and_replace "ld/emulparams/elf_x86_64.sh" "${CURRENT_DIR}/ld.emulparams.elf_x86_64.sh"
223
backup_and_replace "ld/emulparams/elf_x86_64.sh" "${CURRENT_DIR}/ld.emulparams.elf_x86_64.sh"
-
 
224
 
-
 
225
# patch ld/emulparams/i386nto.sh
-
 
226
# RATIONALE: insert i386 QNX particularities for the GNU linker
-
 
227
backup_and_replace "ld/emulparams/i386nto.sh" "${CURRENT_DIR}/ld.emulparams.i386nto.sh"
-
 
228
 
-
 
229
# patch ld/emultempl/nto.em
-
 
230
# RATIONALE: insert i386 QNX particularities for the GNU linker
-
 
231
backup_and_replace "ld/emultempl/nto.em" "${CURRENT_DIR}/ld.emultempl.nto.em"
224
 
232
 
225
# define the tools to use when compiling intermediary programs on the build host
233
# define the tools to use when compiling intermediary programs on the build host
226
export AR_FOR_BUILD="/usr/bin/ar"
234
export AR_FOR_BUILD="/usr/bin/ar"
227
export AS_FOR_BUILD="/usr/bin/as"
235
export AS_FOR_BUILD="/usr/bin/as"
228
export LD_FOR_BUILD="/usr/bin/ld"
236
export LD_FOR_BUILD="/usr/bin/ld"
Line 251... Line 259...
251
 
259
 
252
        # configure and build the GNU binutils. Note that since these are low level tools, we want static binaries as much as possible.
260
        # configure and build the GNU binutils. Note that since these are low level tools, we want static binaries as much as possible.
253
        # NOTE: in this context, --host means the machine the built program is expected to RUN on, and --target the machine the built program will FOCUS on.
261
        # NOTE: in this context, --host means the machine the built program is expected to RUN on, and --target the machine the built program will FOCUS on.
254
        ../../configure \
262
        ../../configure \
255
                        --with-sysroot="${QNX_TARGET}" \
263
                        --with-sysroot="${QNX_TARGET}" \
256
                --prefix="$(dirname "$(dirname "${QNX_HOST}")")/qnx$(echo "${QNXSDK_VERSION}"|awk -F. '{print $1}')/${BUILD_TARGET_ARCH}/usr" \
264
                --prefix="$(dirname "$(dirname "${QNX_HOST}")")/qnx$(echo "${QNXSDK_VERSION}"|awk -F. '{print $1}')/${BUILD_TARGET_ARCH}/usr" \
257
                --host="x86_64-pc-nto-qnx${QNXSDK_VERSION}" \
265
                --host="x86_64-pc-nto-qnx${QNXSDK_VERSION}" \
258
                --target="${TARGET_TRIPLE}" \
266
                --target="${TARGET_TRIPLE}" \
259
                --disable-shared \
267
                --disable-shared \
260
                --disable-nls \
268
                --disable-nls \
261
                --enable-static-link \
269
                --enable-static-link \
262
                --disable-shared-plugins \
270
                --disable-shared-plugins \
263
                --disable-dynamicplugin \
271
                --disable-dynamicplugin \
264
                --disable-pie \
272
                --disable-pie \
265
                --enable-static=yes \
273
                --enable-static=yes \
266
                --enable-shared=no \
274
                --enable-shared=no \
267
                        --enable-threads \
275
                        --enable-threads \
268
                        --disable-bootstrap \
276
                        --disable-bootstrap \
269
                --disable-doc || exit 1
277
                --disable-doc \
-
 
278
                --with-bugurl="pm@pmbaty.com" \
-
 
279
                || exit 1
270
 
280
 
271
        # and build the whole shit
281
        # and build the whole shit
272
        make -j 4 MAKEINFO=/bin/true || exit 1
282
        make -j 4 MAKEINFO=/bin/true || exit 1
273
 
283
 
274
        # now gather all the binutils in one place on the hypervisor's filesystem and name them appropriately
284
        # now gather all the binutils in one place on the hypervisor's filesystem and name them appropriately