簡體   English   中英

Portaudio無法使用macports GCC 4.8進行編譯(-arch命令選項無法識別/錯誤的寄存器名稱錯誤)

[英]Portaudio won't compile using macports GCC 4.8 (-arch command option unrecognized / bad register name errors)

我使用了許多C ++ 11功能,因此我使用macports gcc / g ++編譯了我的C ++代碼。

我無法使用macports gcc 4.8來編譯Portaudio。 使用穩定的版本(pa_stable_v19_20111121.tgz),使用gcc-mp-4.8運行configure,因為編譯器在以下命令中顯示:

bash-3.2$ make
mkdir lib
mkdir -p src/common src/hostapi/alsa src/hostapi/asihpi src/hostapi/asio src/hostapi/coreaudio src/hostapi/dsound src/hostapi/jack src/hostapi/oss src/hostapi/wasapi src/hostapi/wdmks src/hostapi/wmme src/os/unix src/os/win
touch lib-stamp
/bin/sh ./libtool --mode=compile /opt/local/bin/gcc-mp-4.8 -c -std=c99 -O2 -Wall -pedantic -pipe -fPIC -DNDEBUG -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/unix -Werror -arch i386 -arch ppc -arch x86_64 -arch ppc64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DHAVE_NANOSLEEP=1 -DPA_USE_COREAUDIO=1 src/common/pa_allocation.c -o src/common/pa_allocation.lo
libtool: compile:  /opt/local/bin/gcc-mp-4.8 -c -std=c99 -O2 -Wall -pedantic -pipe -fPIC -DNDEBUG -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/unix -Werror -arch i386 -arch ppc -arch x86_64 -arch ppc64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DHAVE_NANOSLEEP=1 -DPA_USE_COREAUDIO=1 src/common/pa_allocation.c  -fno-common -DPIC -o src/common/.libs/pa_allocation.o
gcc-mp-4.8: error: unrecognized command line option '-arch'
gcc-mp-4.8: error: unrecognized command line option '-arch'
make: *** [src/common/pa_allocation.lo] Error 1

使用最新的每日構建(4月5日),我收到一堆“錯誤的寄存器名稱”錯誤:

/bin/sh ./libtool --mode=compile /opt/local/bin/gcc-mp-4.8 -c -std=c99 -O2 -Wall -pedantic -pipe -fPIC -DNDEBUG -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/unix -Werror -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DHAVE_NANOSLEEP=1 -DPA_USE_COREAUDIO=1 src/common/pa_allocation.c -o src/common/pa_allocation.lo
libtool: compile:  /opt/local/bin/gcc-mp-4.8 -c -std=c99 -O2 -Wall -pedantic -pipe -fPIC -DNDEBUG -DPA_LITTLE_ENDIAN -I./include -I./src/common -I./src/os/unix -Werror -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.3 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=8 -DHAVE_NANOSLEEP=1 -DPA_USE_COREAUDIO=1 src/common/pa_allocation.c  -fno-common -DPIC -o src/common/.libs/pa_allocation.o
{standard input}:5:bad register name `%r13'
{standard input}:7:bad register name `%rsi'
{standard input}:8:bad register name `%r12'
{standard input}:10:bad register name `%rdx'
... 

(隨后出現更多錯誤的寄存器名稱錯誤)

錯誤的注冊消息來自CFLAGS同時包含-arch i386和-arch x86_64的事實。 考慮到第一個...因此,所有x86_64特定寄存器的錯誤寄存器錯誤。 一個簡單的解決方法是編輯Makefile並刪除CFLAGS和SHARED_FLAGS變量中的-arch i386。 我使用的是GCC 4.7編譯器,請注意,由於以下警告,我還必須刪除-Werror標志(警告錯誤):

設置了變量“ err”但未使用[-Werror =未使用但設置了變量]

我現在正在尋找如何修復配置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM