Compiling GCC on OS X

本文介绍如何在Mac OS X上从源代码编译安装最新稳定版的GCC,并启用Graphite循环优化功能。文中详细介绍了所需步骤及依赖库的安装配置过程。

In this tutorial, I will show you how to compile from source and install the current stable version of GCC with Graphite loop optimizations on your OS X computer. The instructions from this tutorial were tested with Xcode 6.0.1 and Yosemite (OS X 10.10). Clang, the default compiler for OS X, supports only C, C++ and Objective-C. If you are interested in a modern Fortran compiler, for e.g., you will need gfortran that comes with GCC. Another reason to have the latest stable version of GCC on you Mac is that it provides you with an alternative C and C++ compiler. Testing your code with two different compilers is always a good idea. In order to compile GCC from sources you will need a working C++ compiler. In the remaining of this article I will assume that you have installed the Command Line Tools for Xcode. At the time of this writing Apple’s Command Line Tools maps the gcc and g++ to clang and clang++.

Let’s start by downloading the last stable version of GCC from the GNU website, so go to:http://gcc.gnu.org/mirrors.html and download gcc-4.9.2.tar.bz2. I’ve saved the archive in my Downloadsfolder. We will also need three other libraries for a successful build of gcc: mpcmpfr and gmp. Use the above links and download the last versions for all of them: gmp-6.0.0a.tar.bz2, mpc-1.0.2.tar.gz and mpfr-3.1.2.tar.bz2, also save them in your Downloads folder. For enabling the Graphite loop optimizations you will need two extra libraries, go toftp://gcc.gnu.org/pub/gcc/infrastructure/ and download isl-0.12.2.tar.bz2 and cloog-0.18.1.tar.gz.

Extract the above six archives in your Downloads folder and open a Terminal window.

We will start by compiling the gmp library:

1
2
3
cd ~
cd Downloads
cd gmp*

Create a new folder named build in which the compiler will save the compiled library:

1
mkdir build && cd build

And now the fun part … write in your Terminal:

1
../configure --prefix=/usr/gcc-4.9.2 --enable-cxx

If you see no error message we can actually compile the gmp library:

1
make -j 4

In a few minutes you will have a compiled gmp library. If you see no error message … congratulations, we are ready to install the library in the /usr/gcc-4.9.2 folder (you will need the administrator password for this):

1
sudo make install

We will do the same steps for MPFR now:

1
2
3
4
cd ..
cd ..
cd mpfr*
mkdir build && cd build

Configuration phase:

1
../configure --prefix=/usr/gcc-4.9.2 --with-gmp=/usr/gcc-4.9.2

The second parameter will just inform the configure app that gmp is already installed in /usr/gcc-4.9.2.

After the configure phase is finished, we can make and install the library:

1
2
make -j 4
sudo make install

Now, we are going to build MPC:

1
2
3
4
5
6
7
cd ..
cd ..
cd mpc*
mkdir build && cd build
../configure --prefix=/usr/gcc-4.9.2 --with-gmp=/usr/gcc-4.9.2 --with-mpfr=/usr/gcc-4.9.2
make -j 4
sudo make install

At this time you should have finished to build and install the necessary prerequisites for GCC.

Next step is to build the libraries for the Graphite loop optimizations:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
cd ..
cd ..
cd isl*
mkdir build && cd build
../configure --prefix=/usr/gcc-4.9.2 --with-gmp-prefix=/usr/gcc-4.9.2
make -j 4
sudo make install

cd ..
cd ..
cd cloog*
mkdir build && cd build
../configure --prefix=/usr/gcc-4.9.2 --with-gmp-prefix=/usr/gcc-4.9.2 --with-isl-prefix=/usr/gcc-4.9.2
make -j 4
sudo make install

We are ready to compile GCC now. Be prepared that this could take more than one hour on some machines … Since I’m interested only in the C, C++ and Fortran compilers, this is the configure command I’ve used on my machine:

1
2
3
4
5
cd ..
cd ..
cd gcc*
mkdir build && cd build
../configure --prefix=/usr/gcc-4.9.2 --enable-checking=release --with-gmp=/usr/gcc-4.9.2 --with-mpfr=/usr/gcc-4.9.2 --with-mpc=/usr/gcc-4.9.2 --enable-languages=c,c++,fortran --with-isl=/usr/gcc-4.9.2 --with-cloog=/usr/gcc-4.9.2 --program-suffix=-4.9.2

The above command instructs the configure app where we have installed gmp, mpfr, mpc, ppl and cloog; also it tells to add a prefix to all the resulting executable programs, so for example if you will invoke GCC 4.9.2 you will write gcc-4.9.2, the gcc command will invoke Apple’s version of clang.

If you are interested in building more compilers available in the GCC collection modify the –enable-languages configure option.

And now, the final touches:

1
make -j 4

Grab a coffee, maybe a book, and wait … this should take approximately, depending on your computer configuration, an hour … or more … and about 2GB of your disk space for the build folder.

Install the compiled gcc in /usr/gcc-4.9.2:

1
sudo make install

Now, you can keep the new compiler completely isolated from your Apple’s gcc compiler and, when you need to use it, just modify your path by writing in Terminal:

1
export PATH=/usr/gcc-4.9.2/bin:$PATH

If you want to avoid writing the above command each time you open a Terminal, save the above command in the file .bash_profile from your Home folder.

You should be able to invoke any of the newly compiled compilers C, C++, Fortran …, invoking g++ is as simple as writing in your Terminal:

1
g++-4.9.2 test.cpp -o test

Remember to erase your build directories from Downloads if you want to recover some space.

Let’s check if g++-4.9.2 can compile some C++11 specifics. In your favorite text editor, copy and save this test program (I’ll assume you will save the file in your Home directory):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
//Program to test the new C++11 lambda syntax and initializer lists
#include <iostream>
#include <vector>

using namespace std;

int main()
{
  // Test lambda
  cout << [](int m, int n) { return m + n;} (2,4) << endl;

  // Test initializer lists and range based for loop
  vector<int> V({1,2,3});

  cout << "V =" << endl;
  for(auto e : V) {
    cout << e << endl;
  }

  return 0;
}

Compiling and running the above lambda example:

1
2
3
4
5
6
7
g++-4.9.2 -std=c++11 tst_lambda.cpp -o tst_lambda
./tst_lambda
6
V =
1
2
3

We could also compile a C++ code that uses the new thread header from C++11:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
//Create a C++11 thread from the main program

#include <iostream>
#include <thread>

//This function will be called from a thread
void call_from_thread() {
    std::cout << "Hello, World!" << std::endl;
}

int main() {
    //Launch a thread
    std::thread t1(call_from_thread);

    //Join the thread with the main thread
    t1.join();

    return 0;
}

GCC 4.9.2, finally, implements the C++11 regex header. Next, we present a simple C++11 code that uses regular expressions to check if the input read from stdin is a floating point number:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//Uses a regex to check if the input is a floating point number

#include <iostream>
#include <regex>
#include <string>

using namespace std;

int main()
{
  string input;
  regex rr("((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?");
  //As long as the input is correct ask for another number
  while(true)
  {
    cout<<"Give me a real number!"<<endl;
    cin>>input;
    if(!cin) break;
    //Exit when the user inputs q
    if(input=="q")
      break;
    if(regex_match(input,rr))
      cout<<"float"<<endl;
    else
    {
      cout<<"Invalid input"<<endl;
    }
  }
}

If you are a Fortran programmer, you can use some of the Fortran 2008 features like do concurrent with gfortran-4.9.2:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
integer,parameter::mm=100000
real::a(mm), b(mm)
real::fact=0.5

! initialize the arrays
! ...

do concurrent (i = 1 : mm)
	a(i) = a(i) + b(i)
enddo

end

The above code can be compiled with (assuming you’ve named it tst_concurrent_do.f90):

1
2
gfortran-4.9.2 tst_concurrent_do.f90 -o tst_concurrent_do
./tst_concurrent_do


from https://solarianprogrammer.com/2013/06/11/compiling-gcc-mac-os-x/


内容概要:本文围绕六自由度机械臂的人工神经网络(ANN)设计展开,重点研究了正向与逆向运动学求解、正向动力学控制以及基于拉格朗日-欧拉法推导逆向动力学方程,并通过Matlab代码实现相关算法。文章结合理论推导与仿真实践,利用人工神经网络对复杂的非线性关系进行建模与逼近,提升机械臂运动控制的精度与效率。同时涵盖了路径规划中的RRT算法与B样条优化方法,形成从运动学到动力学再到轨迹优化的完整技术链条。; 适合人群:具备一定机器人学、自动控制理论基础,熟悉Matlab编程,从事智能控制、机器人控制、运动学六自由度机械臂ANN人工神经网络设计:正向逆向运动学求解、正向动力学控制、拉格朗日-欧拉法推导逆向动力学方程(Matlab代码实现)建模等相关方向的研究生、科研人员及工程技术人员。; 使用场景及目标:①掌握机械臂正/逆运动学的数学建模与ANN求解方法;②理解拉格朗日-欧拉法在动力学建模中的应用;③实现基于神经网络的动力学补偿与高精度轨迹跟踪控制;④结合RRT与B样条完成平滑路径规划与优化。; 阅读建议:建议读者结合Matlab代码动手实践,先从运动学建模入手,逐步深入动力学分析与神经网络训练,注重理论推导与仿真实验的结合,以充分理解机械臂控制系统的设计流程与优化策略。
Rebuild started: Project: Project *** Using Compiler 'V6.19', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' Rebuild target 'Project' compiling app_ble.c... ../Src/main.c(200): warning: null passed to a callee that requires a non-null argument [-Wnonnull] fputc('s', NULL); ~~~~^ ../Src/main.c(339): warning: null passed to a callee that requires a non-null argument [-Wnonnull] fputc('w', NULL); ~~~~^ 2 warnings generated. compiling main.c... ../Src/app_at.c(755): warning: passing 'char *' to parameter of type 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign] tcp_rec_show_update((char *)p->payload,p->len); ^~~~~~~~~~~~~~~~~~ ../Src/app_at.c(754): note: passing argument to parameter 'data' here extern void tcp_rec_show_update(uint8_t *data,uint32_t len); ^ 1 warning generated. compiling app_at.c... compiling app_btdm.c... ../Src/app_bt.c(662): warning: format specifies type 'char *' but the argument has type 'void *' [-Wformat] printf("hfg codec connection rsp: %s,type = %d\r\n",Info->p.ptr,codec_type); ~~ ^~~~~~~~~~~ 1 warning generated. compiling app_bt.c... compiling app_task.c... compiling app_hw.c... compiling app_lvgl.c... compiling diskio.c... compiling user_bt.c... compiling autonavi_handler.c... compiling autonavi_profile.c... compiling app_rpmsg.c... compiling msbc_sample.c... compiling app_hid_sdp.c... compiling app_audio.c... compiling sbc_sample.c... compiling mp3_sample.c... compiling btdm_mem.c... compiling controller.c... assembling controller_code.s... compiling host.c... assembling img_rom.s... compiling SWD.c... compiling fal_flash_port.c... compiling fdb_app.c... assembling startup_fr30xx.s... compiling driver_cali.c... compiling trim_fr30xx.c... compiling system_fr30xx.c... compiling driver_efuse.c... compiling driver_frspim.c... compiling driver_flash.c... compiling driver_gpio.c... compiling driver_pmu.c... compiling driver_pmu_iwdt.c... compiling driver_qspi.c... compiling driver_uart.c... compiling driver_trng.c... compiling driver_timer.c... compiling driver_dma.c... compiling driver_display.c... compiling driver_spi_master.c... compiling driver_sd_card.c... compiling driver_sd.c... compiling driver_ipc.c... compiling driver_can.c... compiling driver_pdm.c... compiling driver_i2s.c... compiling driver_psd_dac.c... compiling driver_display_dev.c... compiling driver_saradc.c... compiling driver_st7282_rgb_hw.c... compiling ext_flash.c... compiling co_log.c... ../../../../components/drivers/bsp/spi_flash/IC_W25Qxx.c(240): warning: incompatible pointer types passing 'uint16_t *' (aka 'unsigned short *') to parameter of type 'uint8_t *' (aka 'unsigned char *') [-Wincompatible-pointer-types] __SPI_Read_flash_X1(lu8_DataBuffer, 4, pu8_Buffer, fu32_Length); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../components/drivers/bsp/spi_flash/IC_W25Qxx.h(37): note: expanded from macro '__SPI_Read_flash_X1' #define __SPI_Read_flash_X1(__CMD__, __CSIZE__, __BUFFER__, __SIZE__) spi_master_readflash_X1(&spi_flash_handle, (uint16_t *)__CMD__, __CSIZE__, (void *)__BUFFER__, __SIZE__) ^~~~~~~~~~~~~~~~~~~ ../../../../components/drivers/peripheral/Inc/driver_spi.h(522): note: passing argument to parameter 'fp_CMD_ADDR' here void spi_master_readflash_X1(SPI_HandleTypeDef *hspi, uint8_t *fp_CMD_ADDR, uint32_t fu32_CMDLegnth, uint8_t *fp_Data, uint16_t fu16_Size); ^ 1 warning generated. compiling IC_W25Qxx.c... compiling co_list.c... compiling fal.c... compiling co_util.c... compiling fal_flash.c... compiling fdb.c... compiling fal_partition.c... compiling croutine.c... compiling fdb_utils.c... compiling event_groups.c... compiling list.c... compiling fdb_kvdb.c... compiling stream_buffer.c... compiling queue.c... compiling timers.c... compiling port.c... compiling portasm.c... compiling heap_6.c... assembling cpu_context.s... compiling tasks.c... compiling freertos_sleep.c... compiling heap.c... compiling lv_indev.c... compiling lv_refr.c... compiling lv_obj_pos.c... compiling lv_flex.c... compiling lv_bmp.c... compiling lv_grid.c... compiling lv_ffmpeg.c... compiling lv_freetype.c... compiling lv_fs_fatfs.c... compiling lv_fs_posix.c... compiling lv_fs_stdio.c... compiling lv_fs_win32.c... compiling lv_gif.c... compiling gifdec.c... compiling lodepng.c... compiling lv_png.c... compiling lv_qrcode.c... compiling lv_rlottie.c... compiling lv_sjpg.c... compiling tjpgd.c... compiling lv_fragment.c... compiling lv_fragment_manager.c... compiling lv_gridnav.c... compiling lv_ime_pinyin.c... compiling qrcodegen.c... compiling lv_imgfont.c... compiling lv_msg.c... compiling lv_monkey.c... compiling lv_snapshot.c... compiling lv_theme_basic.c... compiling lv_theme_mono.c... compiling lv_animimg.c... compiling lv_theme_default.c... compiling lv_calendar.c... compiling lv_calendar_header_arrow.c... compiling lv_calendar_header_dropdown.c... compiling lv_imgbtn.c... compiling lv_colorwheel.c... compiling lv_chart.c... compiling lv_keyboard.c... compiling lv_led.c... compiling lv_list.c... compiling lv_menu.c... compiling lv_msgbox.c... compiling lv_meter.c... compiling lv_spinner.c... compiling lv_spinbox.c... compiling lv_span.c... compiling lv_tileview.c... compiling lv_win.c... compiling lv_tabview.c... compiling lv_font.c... compiling lv_extra.c... compiling lv_font_dejavu_16_persian_hebrew.c... compiling lv_font_fmt_txt.c... compiling lv_font_montserrat_8.c... compiling lv_font_loader.c... compiling lv_font_montserrat_10.c... compiling lv_font_montserrat_12.c... compiling lv_font_montserrat_12_subpx.c... compiling lv_font_montserrat_14.c... compiling lv_font_montserrat_16.c... compiling lv_font_montserrat_18.c... compiling lv_font_montserrat_20.c... compiling lv_font_montserrat_22.c... compiling lv_font_montserrat_24.c... compiling lv_font_montserrat_26.c... compiling lv_font_montserrat_28_compressed.c... compiling lv_font_montserrat_28.c... compiling lv_font_montserrat_30.c... compiling lv_font_montserrat_32.c... compiling lv_font_montserrat_34.c... compiling lv_font_montserrat_36.c... compiling lv_font_montserrat_38.c... compiling lv_font_montserrat_40.c... compiling lv_font_montserrat_42.c... compiling lv_font_montserrat_44.c... compiling lv_font_montserrat_48.c... compiling lv_font_montserrat_46.c... compiling lv_font_simsun_16_cjk.c... compiling lv_font_unscii_8.c... compiling lv_font_unscii_16.c... compiling lv_hal_tick.c... compiling lv_hal_indev.c... compiling lv_hal_disp.c... compiling lv_anim.c... compiling lv_anim_timeline.c... compiling lv_area.c... compiling lv_async.c... compiling lv_color.c... compiling lv_bidi.c... compiling lv_fs.c... compiling lv_gc.c... compiling lv_log.c... compiling lv_ll.c... compiling lv_math.c... compiling lv_lru.c... compiling lv_printf.c... compiling lv_mem.c... compiling lv_templ.c... compiling lv_style.c... compiling lv_style_gen.c... compiling lv_tlsf.c... compiling lv_timer.c... compiling lv_utils.c... compiling lv_txt.c... compiling lv_txt_ap.c... compiling lv_arc.c... compiling lv_btn.c... compiling lv_bar.c... compiling lv_checkbox.c... compiling lv_canvas.c... compiling lv_btnmatrix.c... compiling lv_img.c... compiling lv_dropdown.c... compiling lv_objx_templ.c... compiling lv_label.c... compiling lv_line.c... compiling lv_slider.c... compiling lv_switch.c... compiling lv_roller.c... compiling lv_table.c... compiling lv_textarea.c... compiling lv_demo_benchmark.c... compiling img_benchmark_cogwheel_alpha16.c... compiling img_benchmark_cogwheel_argb.c... compiling img_benchmark_cogwheel_chroma_keyed.c... compiling img_benchmark_cogwheel_indexed16.c... compiling img_benchmark_cogwheel_rgb.c... compiling img_benchmark_cogwheel_rgb565a8.c... compiling lv_font_bechmark_montserrat_12_compr_az.c.c... compiling lv_font_bechmark_montserrat_16_compr_az.c.c... compiling lv_font_bechmark_montserrat_28_compr_az.c.c... compiling lv_demo_stress.c... compiling img_clothes.c... compiling lv_demo_widgets.c... compiling img_demo_widgets_avatar.c... compiling img_lvgl_logo.c... compiling lv_demo_music.c... compiling lv_demo_music_list.c... compiling img_lv_demo_music_btn_corner_large.c... compiling img_lv_demo_music_btn_list_pause.c... compiling lv_demo_music_main.c... compiling img_lv_demo_music_btn_list_pause_large.c... compiling img_lv_demo_music_btn_list_play_large.c... compiling img_lv_demo_music_btn_list_play.c... compiling img_lv_demo_music_btn_loop.c... compiling img_lv_demo_music_btn_loop_large.c... compiling img_lv_demo_music_btn_next.c... compiling img_lv_demo_music_btn_next_large.c... compiling img_lv_demo_music_btn_pause.c... compiling img_lv_demo_music_btn_pause_large.c... compiling img_lv_demo_music_btn_play.c... compiling img_lv_demo_music_btn_play_large.c... compiling img_lv_demo_music_btn_prev.c... compiling img_lv_demo_music_btn_prev_large.c... compiling img_lv_demo_music_btn_rnd.c... compiling img_lv_demo_music_btn_rnd_large.c... compiling img_lv_demo_music_corner_left.c... compiling img_lv_demo_music_corner_left_large.c... compiling img_lv_demo_music_corner_right.c... compiling img_lv_demo_music_corner_right_large.c... compiling img_lv_demo_music_cover_1.c... compiling img_lv_demo_music_cover_1_large.c... compiling img_lv_demo_music_cover_2.c... compiling img_lv_demo_music_cover_2_large.c... compiling img_lv_demo_music_cover_3.c... compiling img_lv_demo_music_cover_3_large.c... compiling img_lv_demo_music_icon_1.c... compiling img_lv_demo_music_icon_1_large.c... compiling img_lv_demo_music_icon_2.c... compiling img_lv_demo_music_icon_2_large.c... compiling img_lv_demo_music_icon_3.c... compiling img_lv_demo_music_icon_3_large.c... compiling img_lv_demo_music_icon_4.c... compiling img_lv_demo_music_icon_4_large.c... compiling img_lv_demo_music_list_border.c... compiling img_lv_demo_music_list_border_large.c... compiling img_lv_demo_music_logo.c... compiling img_lv_demo_music_slider_knob.c... compiling img_lv_demo_music_slider_knob_large.c... compiling img_lv_demo_music_wave_bottom.c... compiling img_lv_demo_music_wave_bottom_large.c... compiling img_lv_demo_music_wave_top.c... compiling crc32.c... compiling ffsystem.c... compiling img_lv_demo_music_wave_top_large.c... compiling ffunicode.c... compiling lfs_util.c... compiling ext_flash_program.c... compiling ext_flash_uart.c... compiling ff.c... compiling lfs_port.c... compiling lv_common_function.c... compiling batt_full_yellow.c... compiling lfs.c... compiling batt_full_gren.c... compiling arialuni_bbp1_32px__.c... compiling Number_HarmonyOS_bpp4_16px.c... compiling Number_HarmonyOS_bpp4_12px.c... compiling Number_HarmonyOS_bpp4_36px.c... compiling Number_HarmonyOS_bpp4_44px.c... compiling Number_HarmonyOS_bpp4_92px.c... compiling Number_HarmonyOS_bpp4_20px.c... compiling fr_lv_test_page.c... compiling fr_lv_86box_page.c... compiling fr_lv_app_music_control.c... compiling fr_lv_customer_page.c... compiling fr_lv_instrument_panel.c... compiling fr_lv_list_page.c... compiling fr_lv_instrument_panel_km.c... compiling fr_lv_can_page.c... compiling fr_lv_bt_pan_page.c... compiling fr_guimain.c... compiling fr_watch.c... compiling lv_user_sqlist.c... compiling fr_device_button.c... compiling fr_device_rtc.c... compiling fr_device_encode.c... compiling fr_device_pmu_io.c... compiling fr_device_canfd.c... compiling autoip.c... compiling icmp.c... compiling etharp.c... compiling igmp.c... compiling dhcp.c... compiling ip4.c... compiling ip4_addr.c... compiling dhcp6.c... compiling ethip6.c... compiling ip4_frag.c... compiling icmp6.c... compiling inet6.c... compiling ip6.c... compiling ip6_addr.c... compiling ip6_frag.c... compiling mld6.c... compiling nd6.c... compiling altcp.c... compiling altcp_alloc.c... compiling altcp_tcp.c... compiling def.c... compiling inet_chksum.c... compiling init.c... compiling dns.c... compiling ip.c... compiling mem.c... compiling memp.c... compiling raw.c... compiling netif.c... compiling stats.c... compiling sys.c... compiling pbuf.c... compiling tcp_in.c... compiling tcp.c... compiling tcp_out.c... compiling timeouts.c... compiling udp.c... compiling api_lib.c... compiling err.c... compiling if_api.c... compiling netbuf.c... compiling api_msg.c... compiling netdb.c... compiling netifapi.c... compiling tcpip.c... compiling ethernet.c... compiling ethernetif.c... compiling sys_arch.c... compiling sockets.c... compiling rpmsg.c... compiling rpmsg_ns.c... compiling rpmsg_lite.c... compiling llist.c... compiling rpmsg_queue.c... compiling virtqueue.c... compiling rpmsg_env_freertos.c... compiling rpmsg_platform.c... assembling dsp_code_rom.s... compiling dsp.c... compiling dsp_mem.c... compiling audio_a2dp_sink.c... compiling audio_a2dp_source.c... compiling audio_encoder.c... compiling audio_rpmsg.c... ../../../../components/modules/audio/audio_decoder.c(72): warning: null passed to a callee that requires a non-null argument [-Wnonnull] fputc(hex2char[(value >> 12)&0xf], NULL); ~~~~^ ../../../../components/modules/audio/audio_decoder.c(73): warning: null passed to a callee that requires a non-null argument [-Wnonnull] fputc(hex2char[(value >> 8)&0xf], NULL); ~~~~^ ../../../../components/modules/audio/audio_decoder.c(74): warning: null passed to a callee that requires a non-null argument [-Wnonnull] fputc(hex2char[(value >> 4)&0xf], NULL); ~~~~^ ../../../../components/modules/audio/audio_decoder.c(75): warning: null passed to a callee that requires a non-null argument [-Wnonnull] fputc(hex2char[(value >> 0)&0xf], NULL); ~~~~^ 4 warnings generated. compiling audio_decoder.c... compiling audio_hw.c... compiling audio_scene.c... compiling local_playback.c... compiling audio_sco.c... compiling loopback.c... compiling recorder.c... compiling voice_recognize.c... compiling algorithm.c... compiling codec.c... compiling resample.c... compiling AMS_client.c... compiling simple_gatt_service.c... compiling ANCS_AMS_client.c... compiling hid_service.c... compiling retarget_io.c... linking... ..\..\..\..\components\tools\keil\xip_flash_add_psram.sct(39): warning: L6329W: Pattern algorithm.o(RO) only matches removed unused sections. ..\..\..\..\components\tools\keil\xip_flash_add_psram.sct: Error: L6220E: Load region LR_IROM1 size (1300776 bytes) exceeds limit (1040384 bytes). Region contains 2110 bytes of padding and 2090 bytes of veneers (total 4200 bytes of linker generated content). ..\..\..\..\components\tools\keil\xip_flash_add_psram.sct: Error: L6221E: Execution region RW_RAM_CODE with Execution range [0x1ffe01b0,0x20000c3c) overlaps with Execution region RW_IRAM1 with Execution range [0x20000000,0x2005cb30). ..\..\..\..\components\tools\keil\xip_flash_add_psram.sct: Error: L6388E: ScatterAssert expression ((ImageLength(RW_RAM_CODE_FRONT) + ImageLength(RW_RAM_CODE)) <= 0x20000) failed on line 52 : (0x20c30 <= 0x20000) Finished: 0 information, 1 warning and 3 error messages. ".\Objects\Project.axf" - 3 Error(s), 10 Warning(s). Target not created. Build Time Elapsed: 00:01:15什么问题
09-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值