NLS considerations in Import/Export FAQ (Doc ID 227332.1)

NLS considerations in Import/Export - Frequently Asked Questions (Doc ID 227332.1)
NLS在Import/Export中的注意事项 -- FAQ (Doc ID 227332.1)
应用于:
Oracle Database - Enterprise Edition - Version 8.0.3.0 及以后版本
Oracle Database - Standard Edition - Version 8.0.3.0 及以后版本
所有平台适用


用途:
文档用于使用导出/导入(包括旧的exp/imp 和expdp/impdp)功能时的字符集转换


细节:
主要的全球语言NLS常见问题请看:Note:60134.1 Globalization (NLS) - Frequently Asked Questions
主要的exp/imp常见问题请看:Note:175624.1 Oracle Server - Export and Import FAQ


1. NLS如何影响exp / imp(旧的导入/导出)?
imp和exp都是客户端类的产品,和sqlplus或者oracle的其他形式,所以说翻译数据库的字符集也是由NLS_LANG参数所定义的,所导出的字符集将会被存储在导出文件中,并且该文件被导入的时候,import进程将会检查该文件所使用的字符集,当该字符集和import进程所使用的NLS_LANG参数设定不一致的时候,将会把文件的字符集转换成import进程所使用的字符集,再进行导入,假如有必要的话,会转换成数据库的字符集


参考:
    Note:15095.1  Old Exp/Imp (not datapump) and NLS Considerations
     旧的Exp/Imp (不是数据泵)和NLS的注意事项
    Note:48644.1  Identifying the Export Character Set
         确定导出字符集的设置




2. 当进行exp(旧的导出)的时候怎样设置NLS_LANG这个参数?
    Oracle建议环境设置的NLS_LANG的字符集和你导出的目标库的字符集一致, NLS_LANG=AMERICAN_AMERICA.<source db NLS_CHARACTERSET>
select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
    这个样子从原始数据库导出exportfile文件将会不用执行任何字符集的转换操作,包括原始数据库的所有数据(假如不这样,甚至会储存错误的数据).
    即使这个计划是导入到不同的字符集设置的数据库,字符集的转换也可以直到导入(imp)的时候才进行.


注意:
(1)这个和操作系统的字符集没有关系,假如你的源数据库是WE8MSWIN1252,那么你应当将NLS_LANG在导入之前设置成AMERICAN_AMERICA.WE8MSWIN125,甚至在Unix服务器上也是如此
(2)当与数据库交互的时候(例如sqlplus),需要正确的配置(unix)客户端的字符集,并且可能会与NLS_CHARACTERSET这个参数不同


3. 在使用imp(旧的导入)的时候怎样设置NLS_LANG?
    假如源数据库和目标数据库的字符集设置是一样的,那么在导入和导出的时候,NLS_LANG的字符集设置也应当使用一样的字符集
NLS_LANG=AMERICAN_AMERICA.<source db NLS_CHARACTERSET>
    假如导出和导入的数据库的字符集设置不和NLS_LANG的最佳(首选)字符集一样,那么exp和imp应当还是和源数据库的字符集一样
NLS_LANG=AMERICAN_AMERICA.<source db NLS_CHARACTERSET>
    设置目标数据库的NLS_LANG在导入期间同样是正确的,但是还是有一些限制,当使用一个多字节的字符集类型(例如UTF8)时,在imp和exp期间使用源NLS_CHARACTERSET是最简最好选择,它可以避免任何问题,像IMP16的"请求的字符集转换(type %lu to %lu)不支持".
    所以说,首选的字符集转换的时候就是当导入到目标数据库的时候进行字符集之间的转换.
注意:
(1)这与操作系统无关。如果你的源数据库是一个WE8MSWIN1252数据库。在WE8MSWIN1252导入之前,甚至在一个Unix服务器,你仅仅需要设定NLS_LANG参数为AMERICAN_AMERICA。
(2)在于数据库交互期间(比如sqlplus)你需要正确的配置你的客户端,确切的说,客户端的设置可能和NLS_CHARACTERSET不一样


3,a)仔细检查源数据库上的NLS_CHARACTERSET设置


举个例子:你想使用旧的exp/imp工具从一个WE8MSWIN1252到一个AL32UTF8数据库:


注意,这仅仅是exp/imp的例子,如果你想迁移到AL32UTF8 or UTF8,那么请参考文档260192.1,去在8i, 9i , 10g and 11g 中设置NLS_CHARACTERSET为AL32UTF8/UTF8 (Unicode),或者去看Note 1297961.1 ORA-01401/ORA-12899 当在一个AL32UTF8 / UTF8 (Unicode)或者其他的多字节NLS字符集数据库导入数据时


 select * from nls_database_parameters where parameter = 'NLS_CHARACTERSET';


导出的时候将NLS_LANG参数设置成AMERICAN_AMERICA  <源数据库的NLS字符集的设置>


(如果你想的话,这同样也是用exp把导出的数据当做备份的设置).


在这个例子中我们将创建一个包含WE8MSWIN1252的导出文件.


 on unix this is:
       $ set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
       $ export NLS_LANG
       $ exp ....


       on windows this is:


       c:\>set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
       c:\>exp ....


3.b)导入的时候数据将会随着NLS_LANG参数变成AMERICAN_AMERICA,导入到目标数据库


这个例子的展示了在导入AL32UTF8的数据库之前将NLS_LANG设置为AMERICAN_AMERICA.WE8MSWIN1252的方法


       on unix this is:
       $ set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
       $ export NLS_LANG
       $ imp ....


       on windows this is:


       c:\>set NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252
       c:\>imp ....




当使用imp连接UTF8的数据库插入数据的时候,数据转换到UTF8就已经完成了


我们建议设置明确的NLS_LANG参数值,在Unix中的shell中(->How to Set Unix Environment Variable)或者在Windows中使用dos使用exp或者imp工具的时候.(-> "c:\>set NLS_LANG=AMERICAN_AMERICA.<characterset of the source database>")


4.exp/imp是如何被NLS_LANGUAGE和NLS_TERRITORY这两个参数影响的。
注意:
    通常使用的是默认值AMERICAN_AMERICA,但是例如当你把NLS_LANG设置成FRENCH_FRANCE,这也不会出现问题,即使源环境设置成为GERMAN_GERMANY或者其他的.
    NLS_LANGUAGE和NLS_TERRITORY以及存储在数据库中的实际语言之间没有什么必然的关系。




5.我在imp导入时可能遇到这样的信息(possible ncharset conversion).
你可能会看到类似这样的东西:
     Export file created by EXPORT:V08.01.07 via direct path 
     import done in WE8ISO8859P15 character set and AL16UTF16 NCHAR character set 
     export server uses WE8ISO8859P15 NCHAR character set (possible ncharset conversion)
在导入日志中这是正常的,不是一种错误状态。


如果你为没有为用户或者应用使用N-types,那这就是一个单纯的信息式消息。


这个SELECT语句可以查询所有的N-type表格
select distinct OWNER, TABLE_NAME from DBA_TAB_COLUMNS where DATA_TYPE in ('NCHAR','NVARCHAR2', 'NCLOB');
但即使在这种情况下你用了N-types,例如NCHAR或者NCLOB,这也不是个问题。
(1)数据库将会自动把“旧的”NCHAR字符集转换为一个新的。(另外,区别于“正常”的字符集,在导入导出时NLS_LANG对这个转换没有影响)
(2)AL16UTF16或者 UTF8(在9i中只有这两种可能)是unicode字符集,可以存储任何字符。所以可以预见是没有数据丢失的。参见9i,10g,11g中的国际字符集。


6.怎样得知一个被创建的dmp文件使用了什么样的字符集?
问题很简单:imp system/oracle@database show=yes file=test.dmp
结果如下:
  import done in US7ASCII character set and AL16UTF16 NCHAR character set
      -> this is the current NLS_LANG value set in the environment 
      and the NCHAR characterset of the target database


    import server uses WE8MSWIN1252 character set (possible charset conversion)
      -> this is only shown if the NLS_LANG during this import session is different 
      from the target database characterset, so if you see 3 lines you might have problems :-)


    export client uses UTF8 character set (possible charset conversion)
      -> this is the characterset used during the export session and the
      characterset used in the dmp file.


7.NLS_LANG是怎么影响数据泵的呢?
    数据泵不是用NLS_LANG在数据库之间做转换的。两个数据库字符集之间的转换纯粹是基于源数据库和目标数据库的NLS_CHARACTERSET(或Nchar Nvarchar和Nclob数据类型的NLS_NCHAR_CHARACTERSET)的。
    然而,在参数文件中指定了被用于编码参数文件的NLS_LANG。如果你在参数文件中使用非英语字符的情况下(例如查询参数),这是唯一需要注意的。
    如果你在参数文件中使用非英语字符,NLS_LANG环境变量应该在使用数据泵的会话中设置为符合的参数文件的编码.(!)
    不要对所有低于10.2.0.4(包括10.1.0.5)的10g版本或者更低版本中使用(AL32)UTF8或其他多字节字符集的数据库进行expdp/impdp,11.1.0.6也受到影响。
    它会导致数据损坏,除非补丁5874989已经被应用于导入端。导出不受影响,因此转储文件中的数据是正确的。而且“旧的”exp/imp工具是不受影响的。
    这个问题被解决在10.2.0.4 11.1.0.7补丁集中。在11.2.0.1和以上的版本中被彻底解决,
在windows中的修复方案是:
10.1.0.5.0补丁20(10.1.0.5.20P)或之后,看文档276548.1
10.2.0.3.0补丁11(10.2.0.3.11P)或之后,看文档342443.1


8.是什么原因导致在导入期间(IMP和IMPDP)出现ora-01401或ora-12899?
    9i或者更低的版本会出现ORA-01401:inserted value too large for column。
    10g或者更高的版本会出现ORA-12899:value too large for column
    当从一个使用8位的nls字符集(像we8iso8859p1,we8mswin1252,we8dec…)的数据库向一个16位的NLS_CHARACTERSET(如ja16sjis,zhs16gbk,ko16mswin949),或NLS_CHARACTERSET被设置为AL32UTF8或者UTF8的数据库中导出数据的时候会出现上述两种错误
    请看1297961.1 ora-01401/ora-12899 当向AL32UTF8 / UTF8 (Unicode)或其他多字节NLS_CHARACTERSET数据库导入数据.









=========== copy iot-security from local =============== touch /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/.prepared_ff3f946004efdf04c05e4df40af18419 (cd /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/./; if [ -x ./configure ]; then /usr/bin/find /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/ -name config.guess | xargs -r chmod u+w; /usr/bin/find /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/ -name config.guess | xargs -r -n1 cp /home/tplink/code/be900v2/Iplatform/openwrt/scripts/config.guess; /usr/bin/find /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/ -name config.sub | xargs -r chmod u+w; /usr/bin/find /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/ -name config.sub | xargs -r -n1 cp /home/tplink/code/be900v2/Iplatform/openwrt/scripts/config.sub; AR=arm-buildroot-linux-gnueabi-ar AS="arm-buildroot-linux-gnueabi-gcc -c " LD=arm-buildroot-linux-gnueabi-ld NM=arm-buildroot-linux-gnueabi-nm CC="arm-buildroot-linux-gnueabi-gcc" GCC="arm-buildroot-linux-gnueabi-gcc" CXX="arm-buildroot-linux-gnueabi-g++" RANLIB=arm-buildroot-linux-gnueabi-ranlib STRIP=arm-buildroot-linux-gnueabi-strip OBJCOPY=arm-buildroot-linux-gnueabi-objcopy OBJDUMP=arm-buildroot-linux-gnueabi-objdump SIZE=arm-buildroot-linux-gnueabi-size CFLAGS=" -I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19/../"bcmkernel/include" -I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19/../"bcmkernel/include"/uapi" CXXFLAGS=" -I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19/../"bcmkernel/include" -I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19/../"bcmkernel/include"/uapi" CPPFLAGS="-I/home/tplink/code/be900v2/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be900v2/usr/include -I/home/tplink/code/be900v2/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be900v2/include -I/home/tplink/code/be900v2/Iplatform/openwrt/staging_dir/usr-be900v2/include -I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/usr/include " LDFLAGS="-L/home/tplink/code/be900v2/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be900v2/usr/lib -L/home/tplink/code/be900v2/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be900v2/lib -Wl,-rpath-link,/home/tplink/code/be900v2/Iplatform/openwrt/staging_dir/target-arm-openwrt-linux-uclibc-be900v2/usr/lib -L/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/usr/lib -L/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/toolchain/opt/toolchains/crosstools-arm_softfp-gcc-10.3-linux-4.19-glibc-2.32-binutils-2.36.1/lib " ./configure --target=arm-openwrt-linux-uclibc --host=arm-openwrt-linux-uclibc --build=x86_64-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; ) rm -f /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/.configured_* touch /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/.configured_ make -C "/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19" M="/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0" EXTRA_CFLAGS="-I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19/../"bcmkernel/include" -I/home/tplink/code/be900v2/Iplatform/openwrt/../../bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19/../"bcmkernel/include"/uapi" modules make[4]: Entering directory '/home/tplink/code/be900v2/bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19' $KERNELPATH is [/opt/prpl_xgb834v/sdk_an7581_an7551/prplos/prplos-v3.0.1/build_dir/target-aarch64_cortex-a53_musl/linux-airoha_an7581/linux-5.4.55] $PRIVATE_MODULES_PATH is [] CC [M] /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.o In file included from ././include/linux/compiler_types.h:64:0, from <command-line>:0: ./include/linux/compiler-gcc.h:20:3: error: #error Sorry, your version of GCC is too old - please use 5.1 or newer. # error Sorry, your version of GCC is too old - please use 5.1 or newer. ^ In file included from ./arch/x86/include/asm/pgtable_types.h:348:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/asm-generic/pgtable-nopud.h:21:0: warning: "PUD_SHIFT" redefined #define PUD_SHIFT P4D_SHIFT ^ In file included from ./arch/x86/include/asm/pgtable_types.h:251:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/pgtable_64_types.h:83:0: note: this is the location of the previous definition #define PUD_SHIFT 30 ^ In file included from ./arch/x86/include/asm/pgtable_types.h:348:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/asm-generic/pgtable-nopud.h:22:0: warning: "PTRS_PER_PUD" redefined #define PTRS_PER_PUD 1 ^ In file included from ./arch/x86/include/asm/pgtable_types.h:251:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/pgtable_64_types.h:84:0: note: this is the location of the previous definition #define PTRS_PER_PUD 512 ^ In file included from ./arch/x86/include/asm/pgtable_types.h:348:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/asm-generic/pgtable-nopud.h:23:0: warning: "PUD_SIZE" redefined #define PUD_SIZE (1UL << PUD_SHIFT) ^ In file included from ./arch/x86/include/asm/pgtable_types.h:251:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/pgtable_64_types.h:100:0: note: this is the location of the previous definition #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT) ^ In file included from ./arch/x86/include/asm/pgtable_types.h:348:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/asm-generic/pgtable-nopud.h:24:0: warning: "PUD_MASK" redefined #define PUD_MASK (~(PUD_SIZE-1)) ^ In file included from ./arch/x86/include/asm/pgtable_types.h:251:0, from ./arch/x86/include/asm/processor.h:19, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/pgtable_64_types.h:101:0: note: this is the location of the previous definition #define PUD_MASK (~(PUD_SIZE - 1)) ^ In file included from ./arch/x86/include/asm/cpufeature.h:5:0, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:39, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/processor.h: In function 'load_cr3': ./arch/x86/include/asm/processor.h:251:2: error: implicit declaration of function '__sme_pa' [-Werror=implicit-function-declaration] write_cr3(__sme_pa(pgdir)); ^ In file included from ./include/linux/cache.h:6:0, from ./include/linux/printk.h:9, from ./include/linux/kernel.h:14, from ./include/linux/list.h:9, from ./include/linux/module.h:9, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/processor.h: At top level: ./arch/x86/include/asm/cache.h:8:25: error: 'CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function) #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) ^ ./arch/x86/include/asm/cache.h:9:30: note: in expansion of macro 'L1_CACHE_SHIFT' #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) ^ ./include/linux/cache.h:13:25: note: in expansion of macro 'L1_CACHE_BYTES' #define SMP_CACHE_BYTES L1_CACHE_BYTES ^ ./include/linux/cache.h:35:58: note: in expansion of macro 'SMP_CACHE_BYTES' #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) ^ ./include/linux/percpu-defs.h:149:2: note: in expansion of macro '____cacheline_aligned' ____cacheline_aligned ^ ./arch/x86/include/asm/processor.h:433:1: note: in expansion of macro 'DECLARE_PER_CPU_ALIGNED' DECLARE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); ^ In file included from ./include/asm-generic/percpu.h:7:0, from ./arch/x86/include/asm/percpu.h:544, from ./arch/x86/include/asm/preempt.h:6, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/processor.h:433:32: error: requested alignment is not an integer constant DECLARE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); ^ ./include/linux/percpu-defs.h:101:38: note: in definition of macro 'DECLARE_PER_CPU_SECTION' extern __PCPU_ATTRS(sec) __typeof__(type) name ^ ./arch/x86/include/asm/processor.h:433:1: note: in expansion of macro 'DECLARE_PER_CPU_ALIGNED' DECLARE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); ^ In file included from ./arch/x86/include/asm/preempt.h:7:0, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/linux/thread_info.h:116:19: error: redefinition of 'arch_within_stack_frames' static inline int arch_within_stack_frames(const void * const stack, ^ In file included from ./include/linux/thread_info.h:39:0, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:81, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19, from ./include/linux/module.h:10, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/thread_info.h:186:19: note: previous definition of 'arch_within_stack_frames' was here static inline int arch_within_stack_frames(const void * const stack, ^ In file included from ./include/linux/cache.h:6:0, from ./include/linux/printk.h:9, from ./include/linux/kernel.h:14, from ./include/linux/list.h:9, from ./include/linux/module.h:9, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/cache.h:13:31: error: 'CONFIG_X86_INTERNODE_CACHE_SHIFT' undeclared here (not in a function) #define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT ^ ./include/linux/cache.h:72:35: note: in expansion of macro 'INTERNODE_CACHE_SHIFT' __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) ^ ./include/linux/mmzone.h:112:3: note: in expansion of macro '____cacheline_internodealigned_in_smp' } ____cacheline_internodealigned_in_smp; ^ In file included from ./include/linux/gfp.h:6:0, from ./include/linux/umh.h:4, from ./include/linux/kmod.h:22, from ./include/linux/module.h:13, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/linux/mmzone.h:112:1: error: requested alignment is not an integer constant } ____cacheline_internodealigned_in_smp; ^ ./include/linux/mmzone.h:509:1: error: requested alignment is not an integer constant } ____cacheline_internodealigned_in_smp; ^ In file included from ./include/linux/ktime.h:25:0, from ./include/linux/timer.h:6, from ./include/linux/workqueue.h:9, from ./include/linux/srcu.h:34, from ./include/linux/notifier.h:16, from ./include/linux/memory_hotplug.h:7, from ./include/linux/mmzone.h:749, from ./include/linux/gfp.h:6, from ./include/linux/umh.h:4, from ./include/linux/kmod.h:22, from ./include/linux/module.h:13, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/linux/jiffies.h:80:1: error: requested alignment is not an integer constant extern u64 __cacheline_aligned_in_smp jiffies_64; ^ ./include/linux/jiffies.h:81:1: error: requested alignment is not an integer constant extern unsigned long volatile __cacheline_aligned_in_smp __jiffy_arch_data jiffies; ^ In file included from ./include/linux/srcu.h:62:0, from ./include/linux/notifier.h:16, from ./include/linux/memory_hotplug.h:7, from ./include/linux/mmzone.h:749, from ./include/linux/gfp.h:6, from ./include/linux/umh.h:4, from ./include/linux/kmod.h:22, from ./include/linux/module.h:13, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./include/linux/srcutree.h:43:2: error: requested alignment is not an integer constant spinlock_t __private lock ____cacheline_internodealigned_in_smp; ^ In file included from ./include/linux/elf.h:5:0, from ./include/linux/module.h:15, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/elf.h: In function 'elf_common_init': ./arch/x86/include/asm/elf.h:180:3: error: 'struct thread_struct' has no member named 'fsbase' t->fsbase = t->gsbase = 0; ^ ./arch/x86/include/asm/elf.h:180:15: error: 'struct thread_struct' has no member named 'gsbase' t->fsbase = t->gsbase = 0; ^ ./arch/x86/include/asm/elf.h: At top level: ./arch/x86/include/asm/elf.h:381:1: error: requested alignment is not an integer constant } ____cacheline_aligned; ^ In file included from ./include/linux/module.h:26:0, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20: ./arch/x86/include/asm/module.h:67:2: error: #error unknown processor family #error unknown processor family ^ In file included from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:20:0: ./include/linux/module.h:486:1: error: requested alignment is not an integer constant } ____cacheline_aligned __randomize_layout; ^ In file included from ./include/linux/fs.h:8:0, from ./include/linux/net.h:27, from ./include/linux/skbuff.h:29, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/dcache.h:149:1: error: requested alignment is not an integer constant } ____cacheline_aligned; ^ In file included from ./include/linux/fs.h:13:0, from ./include/linux/net.h:27, from ./include/linux/skbuff.h:29, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/list_lru.h:50:1: error: requested alignment is not an integer constant } ____cacheline_aligned_in_smp; ^ In file included from ./include/uapi/linux/sem.h:5:0, from ./include/linux/sem.h:5, from ./include/linux/sched.h:15, from ./include/linux/ioprio.h:5, from ./include/linux/fs.h:39, from ./include/linux/net.h:27, from ./include/linux/skbuff.h:29, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/ipc.h:29:1: error: requested alignment is not an integer constant } ____cacheline_aligned_in_smp __randomize_layout; ^ In file included from ./include/linux/sched.h:20:0, from ./include/linux/ioprio.h:5, from ./include/linux/fs.h:39, from ./include/linux/net.h:27, from ./include/linux/skbuff.h:29, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/hrtimer.h:159:1: error: requested alignment is not an integer constant } __hrtimer_clock_base_align; ^ ./include/linux/hrtimer.h:221:1: error: requested alignment is not an integer constant } ____cacheline_aligned; ^ In file included from ./include/linux/ioprio.h:5:0, from ./include/linux/fs.h:39, from ./include/linux/net.h:27, from ./include/linux/skbuff.h:29, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/sched.h:408:1: error: requested alignment is not an integer constant } ____cacheline_aligned; ^ In file included from ./include/linux/net.h:27:0, from ./include/linux/skbuff.h:29, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/fs.h:1468:9: error: requested alignment is not an integer constant struct list_lru s_dentry_lru ____cacheline_aligned_in_smp; ^ ./include/linux/fs.h:1469:9: error: requested alignment is not an integer constant struct list_lru s_inode_lru ____cacheline_aligned_in_smp; ^ ./include/linux/fs.h:1481:2: error: requested alignment is not an integer constant spinlock_t s_inode_list_lock ____cacheline_aligned_in_smp; ^ ./include/linux/fs.h:1819:1: error: requested alignment is not an integer constant } ____cacheline_aligned; ^ In file included from ./include/linux/skbuff.h:29:0, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./include/linux/net.h:104:1: error: requested alignment is not an integer constant } ____cacheline_aligned_in_smp; ^ In file included from ./arch/x86/include/asm/realmode.h:15:0, from ./arch/x86/include/asm/acpi.h:33, from ./arch/x86/include/asm/fixmap.h:29, from ./arch/x86/include/asm/pgtable_64.h:17, from ./arch/x86/include/asm/pgtable.h:698, from ./include/linux/memremap.h:7, from ./include/linux/mm.h:27, from ./include/linux/scatterlist.h:8, from ./include/linux/dma-mapping.h:11, from ./include/linux/skbuff.h:34, from ./include/linux/netfilter.h:6, from /home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.c:23: ./arch/x86/include/asm/io.h:44:31: fatal error: asm/early_ioremap.h: No such file or directory #include <asm/early_ioremap.h> ^ cc1: some warnings being treated as errors compilation terminated. scripts/Makefile.build:303: recipe for target '/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.o' failed make[5]: *** [/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/iot_main.o] Error 1 Makefile:1586: recipe for target '_module_/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0' failed make[4]: *** [_module_/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0] Error 2 make[4]: Leaving directory '/home/tplink/code/be900v2/bcm504L04/bcm963xx_5.04L.04/kernel/linux-4.19' Makefile:37: recipe for target '/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/.built' failed make[3]: *** [/home/tplink/code/be900v2/Iplatform/openwrt/build_dir/linux-model_brcm_bcm490x/iot-security-1.0.0/.built] Error 2 make[3]: Leaving directory '/home/tplink/code/be900v2/prplos/platform/feeds/private/iot-security' package/Makefile:133: recipe for target 'package/feeds/feed_private/iot-security/compile' failed make[2]: *** [package/feeds/feed_private/iot-security/compile] Error 2 make[2]: Leaving directory '/home/tplink/code/be900v2/Iplatform/openwrt' /home/tplink/code/be900v2/Iplatform/openwrt/include/toplevel.mk:184: recipe for target 'package/iot-security/compile' failed make[1]: *** [package/iot-security/compile] Error 2 make[1]: Leaving directory '/home/tplink/code/be900v2/Iplatform/openwrt' Makefile:232: recipe for target 'iplatform_package/iot-security/compile' failed make: *** [iplatform_package/iot-security/compile] Error 2
最新发布
11-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值