Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning: section "__textcoal_nt" is deprecate since updating to Mac OSX Sierra [duplicate]

After updating to Sierra I then updated my Xcode from 7.2.1 to Xcode 8. So the problem might've occurred just by updating Xcode. I downgraded back to 7.2.1 and still got the same issue.

This is the error I get when compiling a C++ program

/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:4:11: warning: section "__textcoal_nt" is deprecated
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions
                 ^      ~~~~~~~~~~~~~
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:4:11: note: change section name to "__text"
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions
                 ^      ~~~~~~~~~~~~~
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:54:11: warning: section "__textcoal_nt" is deprecated
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions
                 ^      ~~~~~~~~~~~~~
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:54:11: note: change section name to "__text"
        .section __TEXT,__textcoal_nt,coalesced,pure_instructions

The program still runs, but this message is displayed. Even when the only thing in the code is the class I made called graph and I have code like this the error appears.

void explore(Graph & G, int x)
{
  Node* nodePtr = &G.changeNode(x);
}

I tried doing this in command line and it didn't work

sudo xcode-select -s /Library/Developer/CommandLineTools

This is the build I use in Sublime Text, but even with the other c++ compiler that's not c++11 I get the same error. Error appears on command line too.

{
    "shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++",

    "shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}

The only thing I think can work is using the patches that I've seen on some threads that are on this site

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151012/305992.html

I have no idea how to use them or run though.

like image 360
djent Avatar asked Oct 05 '16 04:10

djent


1 Answers

An answer from here: https://solarianprogrammer.com/2016/09/22/compiling-gcc-6-macos/

You can safely ignore all these warnings, these are related to the assembly code generated by GCC and have nothing to do with your C++ code.

Unfortunately, at this time, there is no way in which to instruct GCC not to use __textcoal_nt, or silence the above warnings. A quick and dirty workaround is to filter the output of the compiler with something like:

g++-6 main.cpp -o main 2>&1 >/dev/null | grep -v -e '^/var/folders/*' -e '^[[:space:]]*\.section' -e '^[[:space:]]*\^[[:space:]]*~*'
like image 76
Ayaz Salikhov Avatar answered Oct 21 '22 21:10

Ayaz Salikhov